Can scripts ran from the `scripts` module be given arguments?
Scenario is as follows, I have a simple build-script type situation going on for building something with
cargo
, then installing it and cleaning up build deps
I'd like to make it more re-usable, so instead of hard-coding the git repo URL I wanted to take it in as $argv[1]
(in fish)
But I am unsure, if I do something like:
will the argument
be passed to the script?
If not, I can deal with thatSolution:
Jump to solution
seems it takes that as one argument, not as script + argument
That explains it, should probably be documented...

7 Replies
It's undocumented, but I think it should work, as it's launching
/tmp/files/scripts/build.fish argument
in your case
Let me know if it worksSolution
seems it takes that as one argument, not as script + argument
That explains it, should probably be documented

You can always run a snippet and specify the full path to the script
I think it would be good to add this support natively in
scripts:
thoughyeah I figured, just wanted to try and see even if just for documentation purposes
I didn't thought about this usecase, but I see it's useful
in the end I realized that what I had as an idea wouldn't quite work anyways so I just made one big build-script instead of one that takes arguments
if I don't forget (I almost certainly will) I might PR the documentation though