Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Shell" core plugin #11

Closed
arcticicestudio opened this issue Jan 7, 2017 · 0 comments
Closed

"Shell" core plugin #11

arcticicestudio opened this issue Jan 7, 2017 · 0 comments

Comments

@arcticicestudio
Copy link
Owner

arcticicestudio commented Jan 7, 2017

Implement the core plugin Shell(snowsaw.Plugin) in the snowsaw.plugins package to run arbitrary shell commands.

The shell task should specify shell commands to be run. Shell tasks should be run in the base snowblock directory that is specified as terminal parameter.

Format

Shell tasks should be able to 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 tasks should support an extended syntax as well, which provides more fine-grained control. A command should be able to be specified as a dictionary that contains the following options:

| Option | Values | Default Value | Required | Description |
| --- | --- | --- |
| command | string | - | Yes | The command to be run. |
| description | string | - | No | A human-readable description. |
| stdin | true, false | false | No | Specifies if the standard input stream is enabled. |
| stdout | true, false | false | No | Specifies if the standard output stream is enabled. |
| stderr | true, false | false | No | Specifies if the standard error stream is enabled. |

Example

[
  {
    "shell": [
      "mkdir -p ~/yogurt",
      ["mkdir -p ~/yogurt", "Creating yogurt folder"],
      {
        "command": "mkdir -p ~/coconut",
        "description": "Creating coconut folder",
        "stderr": true,
        "stdin": true,
        "stdout": true
      }
    ]
  }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant