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

Add directory scope #1

Closed MartinHelmut closed 3 years ago

MartinHelmut commented 3 years ago

There needs to be a way to run different scripts per folder with one command. E.g. litr test executes different scripts on different folders.

MartinHelmut commented 3 years ago

One idea is using categories, defining sub commands that can run for specific folder or list of folders:

[commands.install]
script = "jest"

[commands.install.cpp]
script = "some install script"
# dir = "src/cpp"
dir = [ "src/cpp1", "src/cpp2" ]

This would give the option to run all, one or multiple with the comma operator:

# All
litr install

# One
litr install cpp

# Multiple specific
litr install cpp,js,java

Note: Not using a glob pattern is to avoid matching of files and to be specific. Every folder serves as a "cwd" (current working directory) to the executed command. Therefore executing every of those commands in every folder.

MartinHelmut commented 3 years ago

Sub-commands and folder restrictions are added to https://github.com/krieselreihe/litr/wiki/Setup