You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
commands: add new generic --skip-if command line options
Previously, sambacc had the `--skip-if-file=` command line option that
would skip running a command if a named file exists. I have a need for
doing something similar for environment variable contents. In order to
avoid needing to add a plethora of new --skip-if-x type options over
time, add a more generic `--skip-if=` option and have the value contain
an initial prefix like `file:` or `env:` that determines how the rest of
the value will be parsed and how the skip will be determined (or not).
Deprecate `--skip-if-file`.
Maybe it's a case of over engineering, but at least it's easy to unit
test.
Examples:
* `--skip-if=env:CHAT==yes`, if the environment variable `CHAT` contains
a value equal to "yes" the command will be skipped
* `--skip-if=file:/foo/bar` if the file `/foo/bar` exists the command
will be skipped
* `--skip-if=file:!/foo/bar` if the file `/foo/bar` does not exist the command
will be skipped
* `--skip-if=env:MODE!=777`, if the environment variable `MODE` contains
a value not equal to "777" the command will be skipped
* `--skip-if=always:`, always skip this command (mainly to be used for
testing/hacking on things)
Signed-off-by: John Mulligan <[email protected]>
0 commit comments