krieselreihe / litr

Litr (Language Independent Task Runner) lets you configure and then run any tasks you want for any language.
MIT License
8 stars 0 forks source link

Clarify `dir` option specifics for commands #23

Closed MartinHelmut closed 3 years ago

MartinHelmut commented 3 years ago

Issue

From the Wiki:

dir - A string or array of strings for multiple folders to run commands in. If defined the command will executed in all defined folders relative to the configuration file. This does not apply to sub commands.

The question is if this only applies to the current or sub commands as well. This needs to be clarified.

Option 1

If only per command, to execute all sub commands, the dir option needs to be repeated:

[commands.test]
script = "..."
dir = "src"

[commands.test.another]
script = "..."
dir = "src"

Pros

Cons

Option 2

The dir option defines the directory for every sub command, based on the parent.

[commands.test]
script = "..."
dir = "src"

[commands.test.another]
script = "..."

[commands.test.again]
script = "..."
dir = "../different/place"

Pros

Cons

MartinHelmut commented 3 years ago

Option 1 it is, as a result of actually using the tool and what felt more reasonable.