mirror of
1
0
Fork 0

docs(readme): add docs for using shell conditionally

## what
  - add documentation on using shell command conditionally

  ## how

  ## why

  ## where

  ## usage
This commit is contained in:
Clumsy-Coder 2022-08-11 21:12:47 -06:00
parent 25ef5d5a5f
commit 974156ccde
1 changed files with 14 additions and 0 deletions

View File

@ -332,6 +332,7 @@ fine-grained control.
| `stdin` | Allow a command to read from standard input (default: false) | | `stdin` | Allow a command to read from standard input (default: false) |
| `stdout` | Show a command's output from stdout (default: false) | | `stdout` | Show a command's output from stdout (default: false) |
| `stderr` | Show a command's error output from stderr (default: false) | | `stderr` | Show a command's error output from stderr (default: false) |
| `if` | Run command if a condition is true (default: true) (optional) |
Note that `quiet` controls whether the command (a string) is printed in log Note that `quiet` controls whether the command (a string) is printed in log
output, it does not control whether the output from running the command is output, it does not control whether the output from running the command is
@ -356,6 +357,19 @@ printed (that is controlled by `stdout` / `stderr`). When a command's `stdin` /
stderr: true stderr: true
``` ```
##### Running shell command conditionally
```yaml
- shell:
- command: apt update && apt upgrade -y
if: lsb_release -i | grep -io 'debian'
description: Update APT package repository
- command: dnf update -y
if: lsb_release -i | grep -io 'fedora'
description: Update DNF package repository
```
### Clean ### Clean
Clean commands specify directories that should be checked for dead symbolic Clean commands specify directories that should be checked for dead symbolic