https://blue-build.org/ logo
script module, args / env
# questions
m
If I am using the
script
module, is there a way to set env vars or args to my script? For example, if there is some script and I would normally run
SOME_ENV_VAR=foo ./myscript
or
./myscript bar
, is there some way to do that? E.g.
Copy code
type: script
scripts:
  - SOME_ENV_VAR=foo myscript.sh bar
a
message has been deleted
b
I have a feeling there might be a simpler/better way to do this, but you can use the snippets module and then put something like,
/usr/bin/env - SOME_ENV_VAR=foo myscript.sh bar
g
This should work since the entry is passed into
bash -c
You can also make use of the [
env
](https://blue-build.org/reference/module/#env-optional) property on a module, but that would be vissible to all scripts and snippets you run in that module call
m
Hmm, that's what I was trying. Probably something wrong with the script.