summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAnish Athalye <me@anishathalye.com>2015-02-03 11:53:05 -0500
committerAnish Athalye <me@anishathalye.com>2015-02-03 11:53:05 -0500
commit38c0f65801534a58daceeed3c0fa4482b7421642 (patch)
treeae591874b6f77a3168d8335b20fe7fd6baca91e2 /README.md
parent0b4b79e422908e49e2f1f7128f79b659348092b1 (diff)
Add more options for shell commands
This commit introduces an extended configuration syntax for shell commands. This syntax allows for specifying whether the stdin, stdout, and stderr streams are enabled.
Diffstat (limited to 'README.md')
-rw-r--r--README.md31
1 files changed, 27 insertions, 4 deletions
diff --git a/README.md b/README.md
index 5b77cf0..bc20e9d 100644
--- a/README.md
+++ b/README.md
@@ -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
+ }
]
}]
```