diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 31 |
1 files changed, 27 insertions, 4 deletions
@@ -159,15 +159,28 @@ base directory (that is specified when running the installer). #### Format -Shell commands are specified as an array of commands, where each command is a -two element array containing the actual shell command as the first element and -a human-readable description as the second element. +Shell commands can be specified in several different ways. The simplest way is +just to specify a command as a string containing the command to be run. Another +way is to specify a two element array where the first element is the shell +command and the second is an optional human-readable description. Shell +commands support an extended syntax as well, which provides more fine-grained +control. A command can be specified as a dictionary that contains the command +to be run, a description, and whether stdin, stdout, and stderr are enabled. In +this syntax, all keys are optional except for the command itself. ##### Example (YAML) ```yaml - shell: + - mkdir -p ~/src - [mkdir -p ~/downloads, Creating downloads directory] + - + command: read var && echo Your variable is $var + stdin: true + stdout: true + - + command: read fail + stderr: true ``` ##### Example (JSON) @@ -175,7 +188,17 @@ a human-readable description as the second element. ```json [{ "shell": [ - ["mkdir -p ~/downloads", "Creating downloads directory"] + "mkdir -p ~/src", + ["mkdir -p ~/downloads", "Creating downloads directory"], + { + "command": "read var && echo Your variable is $var", + "stdin": true, + "stdout": true + }, + { + "command": "read fail", + "stderr": true + } ] }] ``` |