DataBiosphere / dsub

Open-source command-line tool to run batch computing tasks and workflows on backend services such as Google Cloud.
Apache License 2.0
265 stars 44 forks source link

Using CLI arguments with custom scripts #164

Closed brspurri closed 5 years ago

brspurri commented 5 years ago

Is there any way to use the --script param with additional parameters?

For instance, the docs show:

--script "my_custom_script.sh"

But I would ideally like to do something like:

--script "my_custom_script.sh param1 param2"

Is this possible in any way?

mbookman commented 5 years ago

Hi @brspurri !

You can't pass positional arguments directly to the script, but you can:

--env PARAM1=param1 \
--env PARAM2=param2 \
--script "my_custom_script.sh"

and then in your script reference ${PARAM1} and ${PARAM2} as environment variables.

brspurri commented 5 years ago

Great! Thanks!