how to run raco command from a script?

196 views Asked by At

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.

1

There are 1 answers

2
Ben Greenman On BEST ANSWER

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