bigbite / build-tools

MIT License
6 stars 1 forks source link

Add support for running a command within a project directory #101

Open jrmd opened 1 year ago

jrmd commented 1 year ago

Description

This PR adds support for the cmd command, which adds the ability to run a command across selected projects within a directory. This can be useful to allow the cli to run repetitive tasks across all project paths. The command also has an alias of run so within the description anywhere that cmd it can be replaced with run. Fixes #112

build-tools cmd [projects] [--quiet] [--continueOnFail] -- <command>

e.g running composer install across all projects

build-tools cmd -- composer install

Options

--quiet

Alias: q This option stops the command from output to stdout

--continueOnFail

Alias: F This option will continue running the command even if one fails, however will still return and exit(1) code on any failure.


example of running composer in specific folders

build-tools cmd project_one,plugin_two -- composer install

Unfortunately due to what seems like a parsing issue with yargs if you are using - args in the command you have to wrap the command in quotes

build-tools cmd -Fq -- "composer install -vvv"

Change Log