{
  "name": "grunt-shell",
  "version": "0.7.0",
  "description": "Run shell commands",
  "keywords": [
    "gruntplugin",
    "shell",
    "command",
    "cmd",
    "exec",
    "spawn",
    "process",
    "cli"
  ],
  "license": "MIT",
  "author": {
    "name": "Sindre Sorhus",
    "email": "sindresorhus@gmail.com",
    "url": "http://sindresorhus.com"
  },
  "files": [
    "tasks"
  ],
  "repository": {
    "type": "git",
    "url": "git://github.com/sindresorhus/grunt-shell"
  },
  "scripts": {
    "test": "grunt"
  },
  "dependencies": {
    "chalk": "~0.4.0"
  },
  "devDependencies": {
    "grunt": "~0.4.0"
  },
  "peerDependencies": {
    "grunt": "~0.4.0"
  },
  "engines": {
    "node": ">=0.8.0"
  },
  "readme": "# grunt-shell [![Build Status](https://travis-ci.org/sindresorhus/grunt-shell.svg?branch=master)](https://travis-ci.org/sindresorhus/grunt-shell)\n\n> Run shell commands\n\nA good way to interact with other CLI tools. E.g. compiling Compass `compass compile` or get the current git branch `git branch`.\n\n\n## Getting Started\n\nIf you haven't used [grunt][] before, be sure to check out the [Getting Started][] guide, as it explains how to create a [gruntfile][Getting Started] as well as install and use grunt plugins. Once you're familiar with that process, install this plugin with this command:\n\n```bash\n$ npm install --save-dev grunt-shell\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-shell');\n```\n\n*Tip: the [load-grunt-tasks](https://github.com/sindresorhus/load-grunt-tasks) module makes it easier to load multiple grunt tasks.*\n\n[grunt]: http://gruntjs.com\n[Getting Started]: https://github.com/gruntjs/grunt/wiki/Getting-started\n\n\n## Documentation\n\n\n### Example config\n\n```js\ngrunt.initConfig({\n\tshell: {\t\t\t\t\t\t\t\t// Task\n\t\tlistFolders: {\t\t\t\t\t\t// Target\n\t\t\toptions: {\t\t\t\t\t\t// Options\n\t\t\t\tstderr: false\n\t\t\t},\n\t\t\tcommand: 'ls'\n\t\t}\n\t}\n});\n\ngrunt.loadNpmTasks('grunt-shell');\ngrunt.registerTask('default', ['shell']);\n```\n\n\n### Example usage\n\n\n#### Run command\n\nCreate a folder named `test`.\n\n```js\ngrunt.initConfig({\n\tshell: {\n\t\tmakeDir: {\n\t\t\tcommand: 'mkdir test'\n\t\t}\n\t}\n});\n```\n\nThe `command` property supports templates:\n\n```js\ngrunt.initConfig({\n\ttestDir: 'test',\n\tshell: {\n\t\tmakeDir: {\n\t\t\tcommand: 'mkdir <%= testDir %>'\n\t\t}\n\t}\n});\n```\n\nYou can also supply a function that returns the command:\n\n```js\ngrunt.initConfig({\n\tshell: {\n\t\thello: {\n\t\t\tcommand: function () {\n\t\t\t\treturn 'echo hello';\n\t\t\t}\n\t\t}\n\t}\n});\n```\nWhich can also take arguments:\n\n```js\nshell: {\n\thello: {\n\t\tcommand: function (greeting) {\n\t\t\treturn 'echo ' + greeting;\n\t\t}\n\t}\n}\n\ngrunt.loadNpmTasks('grunt-shell');\ngrunt.registerTask('default', ['shell:hello']);\n```\n\n\n#### Run command and display the output\n\nOutput a directory listing in your Terminal.\n\n```js\ngrunt.initConfig({\n\tshell: {\n\t\tdirListing: {\n\t\t\tcommand: 'ls'\n\t\t}\n\t}\n});\n```\n\n\n#### Custom callback\n\nDo whatever you want with the output.\n\n```js\nfunction log(err, stdout, stderr, cb) {\n\tconsole.log(stdout);\n\tcb();\n}\n\ngrunt.initConfig({\n\tshell: {\n\t\tdirListing: {\n\t\t\tcommand: 'ls',\n\t\t\toptions: {\n\t\t\t\tcallback: log\n\t\t\t}\n\t\t}\n\t}\n});\n```\n\n\n#### Option passed to the .exec() method\n\nRun a command in another directory. In this example we run it in a subfolder using the `cwd` (current working directory) option.\n\n```js\ngrunt.initConfig({\n\tshell: {\n\t\tsubfolderLs: {\n\t\t\tcommand: 'ls',\n\t\t\toptions: {\n\t\t\t\tstderr: false,\n\t\t\t\texecOptions: {\n\t\t\t\t\tcwd: 'tasks'\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n});\n```\n\n\n#### Multiple commands\n\nRun multiple commands by placing them in an array which is joined using `&&` or `;`. `&&` means run this only if the previous command succeeded. You can also use `&` to have the commands run concurrently (by executing all commands except the last one in a subshell).\n\n```js\ngrunt.initConfig({\n\tshell: {\n\t\tmultiple: {\n\t\t\tcommand: [\n\t\t\t\t'mkdir test',\n\t\t\t\t'cd test',\n\t\t\t\t'ls'\n\t\t\t].join('&&')\n\t\t}\n\t}\n});\n```\n\n\n### Config\n\n\n#### command\n\n**Required**  \nType: `String|Function`\n\nThe command you want to run or a function which returns it. Supports underscore templates.\n\n\n### Options\n\n\n#### stdout\n\nDefault: `true`\nType: `Boolean`\n\nShow stdout in the Terminal.\n\n\n#### stderr\n\nDefault: `true`\nType: `Boolean`\n\nShow stderr in the Terminal.\n\n\n#### stdin\n\nDefault: `true`  \nType: `Boolean`\n\nForward the terminal's stdin to the command.\n\n\n#### failOnError\n\nDefault: `true`\nType: `Boolean`\n\nFail task if it encounters an error. Does not apply if you specify a `callback`.\n\n\n#### callback(err, stdout, stderr, cb)\n\nDefault: `function () {}`  \nType: `Function`\n\nLets you override the default callback with your own.\n\n**Make sure to call the `cb` method when you're done.**\n\n\n#### execOptions\n\nDefault: `undefined`  \nAccepts: Object\n\nSpecify some options to be passed to the [.exec()](http://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback) method:\n\n- `cwd` String *Current working directory of the child process*\n- `env` Object *Environment key-value pairs*\n- `setsid` Boolean\n- `encoding` String *(Default: 'utf8')*\n- `timeout` Number *(Default: 0)*\n- `maxBuffer` Number *(Default: 200\\*1024)*\n- `killSignal` String *(Default: 'SIGTERM')*\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
  "readmeFilename": "readme.md",
  "bugs": {
    "url": "https://github.com/sindresorhus/grunt-shell/issues"
  },
  "homepage": "https://github.com/sindresorhus/grunt-shell",
  "_id": "grunt-shell@0.7.0",
  "_shasum": "2b71e54ee5e56537d34ec06bf997c06ce5b4d34b",
  "_from": "grunt-shell@",
  "_resolved": "https://registry.npmjs.org/grunt-shell/-/grunt-shell-0.7.0.tgz"
}
