1.0.12 • Published 3 years ago
parallel-rc v1.0.12
parallel-rc
Simply run multiple shell commands in parallel.
Installation
npm install --global parallel-rcUsage
Create a command file which contains one shell command per line.
Filename: rc-build
tsc --project tsconfig.build.json
tsc --project tsconfig.types.jsonRun the command file. Optionally, the rc- prefix can be omitted, and the .rc, .sh, .ps1, .cmd, or .txt file extensions can also be omitted.
rc buildYou can also use the longer parallel-rc command, which is an alias for rc.
Options
-a, --all- Run all commands, even if one fails.
-c, --concurrency <num>- Limit maximum number of parallel commands.
-o, --order- Keep command output together and in order.
-s, --shell- Set the shell used to run each command.
--color- Enable color output.
--no-color- Disable color output (overrides
--color).
- Disable color output (overrides
Without an explicit color option, colors are enabled automatically if support is detected (See supports-colors).
Command file format
- A simple shebang-like comment overrides the default shell.
- Blank lines are ignored.
- Lines that start with
#are comments (which are ignored). - All other lines will be executed as shell commands.
Examples of simple shebang-like comments:
#!/usr/bin/env <shell>
#!<shell>Shebang shell options are not supported.
Command running
- Commands are run in a shell:
/bin/shon Unix,process.env.ComSpecon Windows. - Commands use the command file's directory as the working directory.
- Commands are run in parallel, limited to the number of CPU cores + 1 (See the
--concurrencyoption). - Command output is prefixed with the command index from the command file (eg.
"0: output line"). - If a command fails, the
parallel-rcexit code will be non-zero, and no new commands will be started (See the--alloption).