Ben Greenman
Ben Greenman

Reputation: 2002

how to run raco command from a script?

What's the preferred way to run a raco command from a script?

I've been doing things like:

#lang racket
(system "raco frog -b")

but there has got to be a better solution.

Upvotes: 1

Views: 224

Answers (1)

Ben Greenman
Ben Greenman

Reputation: 2002

Yes indeed, there is a better way:

#lang racket
(require raco/all-tools)
(define v (all-tools))
(parameterize ([current-command-line-arguments (vector "-b")])
  (dynamic-require (second (hash-ref v "frog")) #f))

Many thanks to Sam Tobin-Hochstadt.

https://github.com/racket/racket-lang-org/pull/26#issuecomment-267160884

Upvotes: 2

Related Questions