Distributing raco command without `raco`

23 views
Skip to first unread message

Sage Gerard

unread,
Sep 15, 2019, 10:19:48 PM9/15/19
to users\@racket-lang.org
If I release a package `foo` and want to distribute a command with it, I can make it into a raco command where users have to keep typing `raco foo-command`, etc.

Javascript and Python ecosystems let me write a package such that I can install `foo` and the users can just run `foo-command`.

Is there a way to do the same in Racket without building an executable and dropping it into someone's PATH?




Philip McGrath

unread,
Sep 15, 2019, 10:29:26 PM9/15/19
to Sage Gerard, users\@racket-lang.org
In your "info.rkt", define `racket-launcher-names` and `racket-launcher-libraries`, or `gracket-launcher-names` and `gracket-launcher-libraries` for a GUI app: https://docs.racket-lang.org/raco/setup-info.html#(idx._(gentag._14._(lib._scribblings%2Fraco%2Fraco..scrbl)))

Note that this is handled by `raco setup`, not `raco pkg`, so you can do this in an "info.rkt" file in any collection, not just at the top level directory of the package. Here's an example "info.rkt" file from one of my packages that uses `gracket-launcher-names`: https://bitbucket.org/digitalricoeur/tei-utils/src/master/tei/tools/info.rkt

-Philip


--
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/yjmAa_d-Ww-PD337y-cM_Y1aWngZN4iEpzawcnc1YwAgYx20D8-DKtEAut5D3UqwQ3iS7sJt0Mk9JsH_xLKQE4R1opMEhXa8FkzgaHojDCc%3D%40sagegerard.com.

Sage Gerard

unread,
Sep 15, 2019, 10:33:19 PM9/15/19
to phi...@philipmcgrath.com, us...@racket-lang.org
Perfect, thank you. I'll put up a PR to add that as a margin note in https://docs.racket-lang.org/raco/command.html



-------- Original Message --------
Reply all
Reply to author
Forward
0 new messages