task icon indicating copy to clipboard operation
task copied to clipboard

add environment variable-based configuration

Open droopy4096 opened this issue 2 years ago • 2 comments

When using task in larger setups it would be more convenient to pass some of the configuration options via the environment variable so as not to update every line containing task invocation to add or remove options. Consider scenario of having several scripts with contents like:

#!/bin/sh

task target1
#....

task target2

to make them run in dry mode one has to alter all the shell scripts to include --dry option. However with environment variable configuration one can simply:

export TASK_DRY=yes

and run scripts with all task invocations picking up desired option automatically.

Of course --dry is only a sample, control of concurrency between workstation and CI node would be another good example. As well as increasing verbosity while debugging etc.

droopy4096 avatar Mar 17 '23 16:03 droopy4096

I love this, exactly what I was looking for (specify the taskfile/entrypoint via an env var) - how do we get this in main so we can start using it?

jwater7 avatar Apr 22 '24 22:04 jwater7

someone will have to review and approve https://github.com/go-task/task/pull/1067

droopy4096 avatar Apr 24 '24 05:04 droopy4096