Command Array

The command array specifies commands that should be run when a step is executed. It can be defined in either install or remove blocks inside the step exe definition (in the cmd key), and should be an array of strings, each string being a valid command line command for the host system.

Below is an example with the command array in context.

{
  "name": "say hello",
  "exe": {
    "install": {
      "prompts": [
        {
          "prompt": "Please enter your name",
          "var": "name"
        }
      ],
      "cmd": [
        "echo \"hello {{ name }}\"",
        "touch $HOME/.greeted"
      ]
    }
  },
  "tags": "example step"
}

It will be executed if the skip command returns a non zero result (if defined), and after the user has been prompted for all input (if defined).

Each command will be executed in the order they are specified within the array, and they run sequentially, so it is possible to have a command that depends on a previous command.