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){functionality-name}
: name of the component{namespace}
: namespace of the component{platform}
: selected platform id (only when –apply_platform is used)
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_platform , -a |
Fills in the {platform} 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 |
--cmd |
The command to execute for each viash config file in the namespace. This is a required argument. | String |
--config_mod , -c |
Modify a viash config at runtime using dynamic config modding. | List[String] |
--dry_run , -d |
Perform a dry run. | Boolean |
--parallel , -l |
Whether or not to run the process in parallel. | Boolean |
--platform , -p |
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 |
--src , -s |
A source directory containing viash config files, possibly structured in a hierarchical folder structure. Default: src/. | String |
--help , -h |
Show help message |