Open justinabrahms opened 12 months ago
IDK what's you use case. Please, describe it in more details.
Currently, you can create a script file:
cat > hello.sh <<EOF
printf "hello!\n"
EOF
chmod +x hello.sh
Then, in devshell.toml
(this repo uses this file for the default devshell), create a command that runs that file:
# ...
[devshell]
# ...
[[commands]]
help = "prints hello"
name = "hello"
command = "$PRJ_ROOT/hello.sh"
# ...
Now, you can run
$ hello
hello!
I think that will work for me.
I'm not sure what else to say about the use cases.
In that case, the best thing is to put the scripts in a ./bin or ./scripts folder in your project. Then only use Nix and devshell to bring the dependencies (eg: curl, jq, ...) as @deemp described.
Is your feature request related to a problem? Please describe.
I'd like syntax highlighting for bash scripts and similar, which I don't get in TOML.
Also, I'd like it if the scripts were invokable by people who don't want to use nix, provided they have a properly configured environment.
Describe the solution you'd like
instead of
command = '''...'''
, I'd likecommandFile = './scripts/foo.sh'
Describe alternatives you've considered
perhaps some toml import synatx something or other, but that seems too complex.
Additional context