Run any custom commands with Nx.
Options can be configured in project.json
when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/reference/project-configuration#targets.
project.json
:
{ "targets": { "ls-project-root": { "executor": "nx:run-commands", "options": { "command": "ls apps/frontend/src" } } } }
❯
nx run frontend:ls-project-root
ExamplesThe commands
option accepts as many commands as you want. By default, they all run in parallel. You can run them sequentially by setting parallel: false
:
"create-script": { "executor": "nx:run-commands", "options": { "commands": [ "mkdir -p apps/frontend/scripts", "touch apps/frontend/scripts/my-script.sh", "chmod +x apps/frontend/scripts/my-script.sh" ], "parallel": false } }
This type has all of the properties below, but must also match this type:
oneOf [
required: commands, required: command]
Array<
oneOf [
object , string]
>
Commands to run in child process.
oneOf [Array<string>, string]
Command to run in child process.
Run commands in parallel.
oneOf [Array<string>, string]
Extra arguments. You can pass them as follows: nx run project:target --args='--wait=100'. You can then use {args.wait} syntax to interpolate them in the workspace config file. See example above
Use colors when showing output of command.
Current working directory of the commands. If it's not specified the commands will run in the workspace root, if a relative path is specified the commands will run in that path relative to the workspace root and if it's an absolute path the commands will run in that path.
You may specify a custom .env file path.
Environment variables that will be made available to the commands. This property has priority over the .env
files.
Whether arguments should be forwarded when interpolation is not present.
oneOf [string, Array<string>]
String or array of strings to appear in stdout
or stderr
that indicate that the task is done. When running multiple commands, this option can only be used when parallel
is set to true
. If not specified, the task is done when all the child processes complete.
Whether commands should be run with a tty terminal
Extra properties of any type may be provided to this object.
__unparsed__InternalHidden
No description available.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4