Viash Ns Exec
Execute a command for all found Viash components. The syntax of this command is inspired by find . -exec echo {} \;
.
The following fields are automatically replaced:
{}
|{path}
: path to the config file{abs-path}
: absolute path to the config file{dir}
: path to the parent directory of the config file{abs-dir}
: absolute path to the directory of the config file{main-script}
: path to the main script (if any){abs-main-script}
: absolute path to the main script (if any){name}
: name of the component{functionality-name}
: name of the component (deprecated){namespace}
: namespace of the component{runner}
: selected runner id (only when –apply_runner is used){engine}
: selected engine id (only when –apply_engine is used){output}
: path to the destination directory when building the component{abs-output}
: absolute path to the destination directory when building the component
A command suffixed by \;
(or nothing) will execute one command for each of the Viash components, whereas a command suffixed by +
will execute one command for all Viash components.
Usage:
viash ns exec 'echo {path} \\;'
viash ns exec 'chmod +x {main-script} +'
Argument | Description | Type |
---|---|---|
--apply_engine , -e |
Fills in the {engine} and {output} field by applying each engine to the config separately. Note that this results in the provided command being applied once for every engine that matches the –engine regex. | Boolean |
--apply_platform , -a |
Deprecated. Use –apply_runner and –apply_engine instead. Fills in the {platform} and {output} field by applying each platform to the config separately. Note that this results in the provided command being applied once for every platform that matches the –platform regex. | Boolean |
--apply_runner , -r |
Fills in the {runner} and {output} field by applying each runner to the config separately. Note that this results in the provided command being applied once for every runner that matches the –runner regex. | Boolean |
--cmd |
The command to execute for each viash config file in the namespace. This is a required argument. | String |
config |
Filter which component get selected by specifying the config path. | String |
--config_mod , -c |
Modify a viash config at runtime using dynamic config modding. | List[String] |
--dry_run , -d |
Perform a dry run. | Boolean |
--engine |
Acts as a regular expression to filter the engine ids specified in the found config files. If this is not provided, all engines will be used. If no engines are defined in a config, the native engine will be used. | String |
--parallel , -l |
Whether or not to run the process in parallel. | Boolean |
--platform , -p |
Deprecated. Use –runner and –engine instead. Acts as a regular expression to filter the platform ids specified in the found config files. If this is not provided, all platforms will be used. If no platforms are defined in a config, the native platform will be used. In addition, the path to a platform yaml file can also be specified. | String |
--query , -q |
Filter which components get selected by component and namespace name. Can be a regex. Example: “^mynamespace/component1$”. | String |
--query_name |
Filter which components get selected by component name. Can be a regex. Example: “^component1”. | String |
--query_namespace , -n |
Filter which namespaces get selected by namespace name. Can be a regex. Example: “^mynamespace$”. | String |
--runner |
Acts as a regular expression to filter the runner ids specified in the found config files. If this is not provided, all runners will be used. If no runners are defined in a config, the executable runner will be used. | String |
--src , -s |
A source directory containing viash config files, possibly structured in a hierarchical folder structure. Default: src/. | String |
--help , -h |
Show help message |