A simple command line utility for running commands in specific projects or directories.
yarn add --dev run-in-every
run-in-every [target-name] [...options] -- command [...args]
For example:
run-in-every eslint-project --echo --parallel -- eslint --config {configFileName} .
--bail
(-b
) exit immediately upon failure.--quiet
(-q
) silence user command output.--echo
(-e
) echo run-in-every output.--parallel
(-p
) run commands in parallel.--concurrency <number>
concurrency for parallel mode.
Target name eslint-project
, alias eslint
.
--nested
include nested-projects.
configFileName
file name of the matched config file (Path.basename()
).
Target name tslint-project
, alias tslint
.
--nested
include nested-projects.
configFileName
file name of the matched config file (Path.basename()
).
Target name ts-project
, alias ts
.
run-in-every ts-project -- tsc
--include-variant <pattern>
include varianttsconfig.<pattern>.json
.--only-variant <pattern>
only varianttsconfig.<pattern>.json
.--include-composite
include composite projects (extends
is not handled).--only-composite
match only composite projects (extends
is not handled).
configFileName
file name of the matched config file (Path.basename()
).
Target name directory
.
--pattern <string>
glob pattern of directory name.
dirName
directory name of the matched directory (Path.basename()
).
Target name directory-with-file
.
E.g.:
run-in-every directory-with-file --pattern '*/**/package.json' --data script.build -- pwd
run-in-every directory-with-file --pattern '*/**/config.json' --data 'host: "localhost"' -- pwd
--pattern <string>
glob pattern of file to match.--data <string>
data pattern of file to match, format:<key>[:<value>][,...]
, e.g.:'name: "run-in-every", version: "0.1.0"'
.<key>
:- Plain string will be split as path keys, e.g.
scripts.build
. - JSON string array will be directly treated as path keys, e.g.
["scripts", "build"]
.
- Plain string will be split as path keys, e.g.
<value>
: JSON value to be compared with_.isEqual
.- If
<value>
is absent, it tests whether the path exists.
fileName
file name of the matched file (Path.basename()
).
MIT License.