0.16.0 • Published 4 years ago
@kie-tooling-core/run-script-if v0.16.0
Options:
  --help           Show help                                           [boolean]
  --version        Show version number                                 [boolean]
  --env            Name of the environment variables which value will be
                   compared to --eq.                                    [string]
  --bool           Boolean value to be used as condition                [string]
  --eq, --equals   Value to be compared with the condition supplied. Both --bool
                   and --env.                         [string] [default: "true"]
  --then           Command(s) to execute if the condition is true.
                                                              [array] [required]
  --else           Command(s) to execute if the condition is false.
                                                           [array] [default: []]
  --true-if-empty  If the environment variable is not set, makes the condition
                   be true.                           [boolean] [default: false]
  --silent         Hide info logs from output. Logs from commands will still
                   show.                              [boolean] [default: false]
  --force          Makes condition be true. Runs command(s) supplied to --then.
                                                      [boolean] [default: false]
  --catch          Command(s) to execute at the end of execution if one of the
                   commands being executed fails.          [array] [default: []]
  --finally        Command(s) to execute at the end of execution. Provided
                   commands will run even if one of the commands being executed
                   fails.                                  [array] [default: []]
CLI tool to help executing shell scripts conditionally with a friendly syntax on
Linux, macOS, and Windows.
__NOTE FOR WINDOWS USAGE__:
Because 'run-script-if' was created with Yarn/NPM scripts, environment variables
and sub-expression syntax (`$(expr)`) in mind, 'run-script-if' will force the
provided commands to be executed on PowerShell.
This is because Yarn and NPM default to the CMD shell on Windows, making it not
ideal for sub-expression-dependent commands.
Apart from using it on commands, it's also possible to use the sub-expression
syntax on boolean conditions, like:
$ run-script-if --bool "$(my-custom-command --isEnabled)" --then "echo 'Hello'"0.16.0
4 years ago
0.15.0
4 years ago
0.14.1
4 years ago
0.14.0
4 years ago
0.13.0
4 years ago
0.12.0
4 years ago
0.0.16
4 years ago
0.0.11
4 years ago
0.0.12
4 years ago
0.0.13
4 years ago
0.0.14
4 years ago
0.0.15
4 years ago
0.0.10
4 years ago
0.0.9
4 years ago
0.0.8
4 years ago
0.0.7
4 years ago
0.0.6
4 years ago
0.0.5
4 years ago
0.0.4
4 years ago
0.0.3
4 years ago
0.0.2
4 years ago
0.0.1
4 years ago
0.10.0
4 years ago