{"name":"grunt-exec","description":"Grunt task for executing shell commands.","version":"0.3.0","homepage":"https://github.com/jharding/grunt-exec","author":{"name":"Jake Harding","email":"jacob.s.harding@gmail.com"},"repository":{"type":"git","url":"git://github.com/jharding/grunt-exec.git"},"bugs":{"url":"https://github.com/jharding/grunt-exec/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jharding/grunt-exec/blob/master/LICENSE-MIT"}],"main":"grunt.js","bin":{"grunt-exec":"bin/grunt-exec"},"engines":{"node":">=0.6.0"},"scripts":{"test":"grunt test"},"devDependencies":{"grunt":"~0.3.7"},"keywords":["grunt","gruntplugin"],"_id":"grunt-exec@0.3.0","dist":{"shasum":"d34a2a328f8c4a059792d371637aa64e28521f47","tarball":"http://registry-npm.ywwl.com/grunt-exec/download/grunt-exec-0.3.0.tgz","integrity":"sha512-4qTyamiMncCOmTaChU4qsD2DN5TqOQVZ/ssfRCsM6pCy5omauIJxO2M1ixTemOX1N++U7shhT9Pub6/ZVIXVQA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDs6DGWa2nIXhfh1/DJ450knXMqsxEXAyxeTeZlPL60rwIhAPdAQJ6LTA0pbiDdQimhf3fiv7AYFusD2mLQcH39kOmt"}],"size":3247,"noattachment":false,"key":"/grunt-exec/-/grunt-exec-0.3.0.tgz"},"_npmVersion":"1.1.59","_npmUser":{"name":"jharding","email":"jacob.s.harding@gmail.com"},"maintainers":[{"name":"jharding","email":"jacob.s.harding@gmail.com"}],"directories":{},"readme":"[![build status](https://secure.travis-ci.org/jharding/grunt-exec.png?branch=master)](http://travis-ci.org/jharding/grunt-exec)\ngrunt-exec\n==========\n\nGrunt plugin for executing shell commands.\n\n[![NPM](https://nodei.co/npm/grunt-exec.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/grunt-exec/)\n[![NPM](https://nodei.co/npm-dl/grunt-exec.png)](https://nodei.co/npm/grunt-exec/)\n\nInstallation\n------------\n\nInstall grunt-exec using npm:\n\n```\n$ npm install grunt-exec --save-dev\n```\n\nThen add this line to your project's *Gruntfile.js*:\n\n```javascript\ngrunt.loadNpmTasks('grunt-exec');\n```\n\nUsage\n-----\n\nThis plugin is a [multi task][types_of_tasks], meaning that grunt will \nautomatically iterate over all exec targets if a target is not specified.\n\nIf the exit code generated by the specified shell command is greater than 0, \ngrunt-exec will assume an error has occurred and will abort grunt immediately.\n\n[types_of_tasks]: http://gruntjs.com/configuring-tasks#task-configuration-and-targets\n\n### Properties\n\n*  __command__ (alias: __cmd__): The shell command to be executed. Must be a \n  string or a function that returns a string.\n*  __stdin__: If `true`, stdin will be redirected from the child process to the current process allowing user interactivity (EXPERIMENTAL)\n*  __stdout__: If `true`, stdout will be printed. Defaults to `true`.\n*  __stderr__: If `true`, stderr will be printed. Defaults to `true`.\n*  __cwd__: Current working directory of the shell command. Defaults to the \n  directory containing your Gruntfile.\n*  __exitCode__ (alias: __exitCodes__): The expected exit code(s), task will \n  fail if the actual exit code doesn't match. Defaults to `0`. Can be an array \n  for multiple allowed exit codes.\n*  __callback__: The callback function passed `child_process.exec`. Defaults to \n  a noop.\n* __callbackArgs__: Additional arguments to pass to the callback. Defaults to empty array.\n* __sync__: Whether to use `child_process.spawnSync`. Defaults to false.\n* __options__: Options to provide to `child_process.exec`. [NodeJS Documentation](http://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback)\n  - `cwd` String Current working directory of the child process\n  - `env` Object Environment key-value pairs\n  - `encoding` String *(Default: 'utf8')*\n  - `shell` String Shell to execute the command with *(Default: '/bin/sh' on UNIX, 'cmd.exe' on Windows, The shell should understand the -c switch on UNIX or /s /c on Windows. On Windows, command line parsing should be compatible with cmd.exe.)*\n  - `timeout` Number *(Default: 0)*\n  - `maxBuffer` Number largest amount of data (in bytes) allowed on stdout or stderr - if exceeded child process is killed **(Default: 200*1024)**\n  - `killSignal` String *(Default: 'SIGTERM')*\n  - `uid` Number Sets the user identity of the process. (See [setuid(2)](http://man7.org/linux/man-pages/man2/setuid.2.html).)\n  - `gid` Number Sets the group identity of the process. (See [setgid(2)](http://man7.org/linux/man-pages/man2/setgid.2.html).)\n\nIf the configuration is instead a simple `string`, it will be\ninterpreted as a full command itself:\n\n```javascript\nexec: {\n  echo_something: 'echo \"This is something\"'\n}\n```\n\n### Command Functions\n\nIf you plan on doing advanced stuff with grunt-exec, you'll most likely be using \nfunctions for the `command` property of your exec targets. This section details \na couple of helpful tips about command functions that could help make your life \neasier.\n\n#### Passing arguments from the command line\n\nCommand functions can be called with arbitrary arguments. Let's say we have the \nfollowing exec target that echoes a formatted name:\n\n```javascript\nexec: {\n  echo_name: {\n    cmd: function(firstName, lastName) {\n      var formattedName = [\n        lastName.toUpperCase(),\n        firstName.toUpperCase()\n      ].join(', ');\n\n      return 'echo ' + formattedName;\n    }\n  }\n}\n```\n\nIn order to get `SIMPSON, HOMER` echoed, you'd run \n`grunt exec:echo_name:homer:simpson` from the command line.\n\n### Accessing `grunt` object\n\nAll command functions are called in the context of the `grunt` object that they \nare being ran with. This means you can access the `grunt` object through `this`.\n\n### Example\n\nThe following examples are available in grunt-exec's Gruntfile.\n\n```javascript\ngrunt.initConfig({\n  exec: {\n    remove_logs: {\n      command: 'rm -f *.log',\n      stdout: false,\n      stderr: false\n    },\n    list_files: {\n      cmd: 'ls -l **'\n    },\n    list_all_files: 'ls -la',\n    echo_grunt_version: {\n      cmd: function() { return 'echo ' + this.version; }\n    },\n    echo_name: {\n      cmd: function(firstName, lastName) {\n        var formattedName = [\n          lastName.toUpperCase(),\n          firstName.toUpperCase()\n        ].join(', ');\n\n        return 'echo ' + formattedName;\n      }\n    }\n  }\n});\n```\n\nTesting\n-------\n\n```\n$ cd grunt-exec\n$ npm test\n```\n\nIssues\n------\n\nFound a bug? Create an issue on GitHub.\n\nhttps://github.com/jharding/grunt-exec/issues\n\nVersioning\n----------\n\nFor transparency and insight into the release cycle, releases will be numbered \nwith the follow format:\n\n`<major>.<minor>.<patch>`\n\nAnd constructed with the following guidelines:\n\n* Breaking backwards compatibility bumps the major\n* New additions without breaking backwards compatibility bumps the minor\n* Bug fixes and misc changes bump the patch\n\nFor more information on semantic versioning, please visit http://semver.org/.\n\nLicense\n-------\n\nOriginal Copyright (c) 2012-2014 [Jake Harding](http://thejakeharding.com)\nCopyright (c) 2016 grunt-exec\nLicensed under the [MIT License](http://www.opensource.org/licenses/mit-license.php).\n","publish_time":1347691603210,"_cnpm_publish_time":1347691603210,"dist-tags":{"beta":"0.4.7-0","latest":"3.0.0","next":"2.0.0-alpha.2"}}