Run in Every
A simple command line utility for running commands in specific projects or directories.
Installation
yarn add --dev run-in-everyUsage
run-in-every [target-name] [...options] -- command [...args]For example:
run-in-every eslint-project --echo --parallel -- eslint --config {configFileName} .Common Options
--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.
Supported Targets
ESLint Project
Target name eslint-project, alias eslint.
options
--nestedinclude nested-projects.
variables
configFileNamefile name of the matched config file (Path.basename()).
TSLint Project
Target name tslint-project, alias tslint.
options
--nestedinclude nested-projects.
variables
configFileNamefile name of the matched config file (Path.basename()).
TypeScript Project
Target name ts-project, alias ts.
run-in-every ts-project -- tscoptions
--include-variant <pattern>include varianttsconfig.<pattern>.json.--only-variant <pattern>only varianttsconfig.<pattern>.json.--include-compositeinclude composite projects (extendsis not handled).--only-compositematch only composite projects (extendsis not handled).
variables
configFileNamefile name of the matched config file (Path.basename()).
Directory
Target name directory.
options
--pattern <string>glob pattern of directory name.
variables
dirNamedirectory name of the matched directory (Path.basename()).
Directory with File
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"' -- pwdoptions
--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.
variables
fileNamefile name of the matched file (Path.basename()).
License
MIT License.