[racket] Adding a raco command not working for me
Thank you.
So on http://docs.racket-lang.org/planet2/Developing_Packages.html
should it switch the steps around? Folks should not run `raco pkg
install --link demo` until _after_ they create an info.rkt in demo?
Because when I try to run `raco pkg install --link` now, it does
nothing, telling me:
$ raco pkg install --link frog
raco pkg install: package is already installed
package: frog
OK. So I just tried:
$ raco pkg remove frog
(FYI that gives a huge amount of output, which doesn't say anything
about removing `frog`, but a lot about making other stuff. But `raco
pkg show` confirms it was removed.)
Next I try:
$ raco pkg install --link frog
And I try:
$ raco pkg show
<It's installed.>
But:
$ raco help
Does not show my command listed.
And
$ raco frog
raco frog
/Users/greg/src/plt/racket/bin/raco: Unrecognized command: frog
Usage: raco <command> <option> ... <arg> ...
Frequently used commands:
docs search and view documentation
make compile source to bytecode
setup install and build libraries and documentation
pkg manage packages
link manage library-collection directories
planet manage Planet package installations
exe create executable
test run tests associated with files/directories
pack pack files/collections into a .plt archive
A command can be specified by an unambiguous prefix.
See `raco help' for a complete list of commands.
See `raco help <command>' for help on a command.
So it's still not working. From my (probably not great) understanding
for getinfo.rkt, I'm still not sure how it _could_ work because these
linked collections aren't returned by
`current-library-collection-paths`.
Or quite likely I'm doing something dumb.
On Sat, Apr 6, 2013 at 10:47 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> At Sat, 6 Apr 2013 10:21:53 -0400, Greg Hendershott wrote:
>> I'm trying to add a raco command, following
>> http://docs.racket-lang.org/raco/command.html
>>
>> My info.rkt is simply this:
>>
>> #lang setup/infotab
>> (define deps (list "markdown" "rackjure"))
>> (define raco-commands '(("frog" frog "run Frog" #f)))
>>
>> I'm trying to do this for a collection installed using `raco pkg
>> install --link`, to try it out and test it. However my command doesn't
>> seem to be recognized by raco.
>
> That should work.
>
> Here's what I tried:
>
> * Created a directory "demo".
>
> * Created a subdirectory "demo/demo".
>
> * Added "demo/demo/setup.rkt" as
>
> #lang setup/infotab
> (define raco-commands '(("demo" demo "run Demo" #f)))
>
> * Added "demo/demo/main.rkt" as
>
> #lang racket/base
> 'Demo!
>
> * Installed with `raco pkg install --link demo'
>
> [This step internally runs `raco setup demo', which registers the
> `raco-commands 'spec of "info.rkt" and makes the `raco demo'
> command available.]
>
> * Ran `raco demo' => got "'Demo!" as output.
>
> Since it's not working for you, I wonder what `raco setup frog' says.
> Does it seem to set up the `frog' collection? And does `raco frog' work
> afterward?
>