1 | { |
---|
2 | "name": "grunt-exec", |
---|
3 | "description": "Grunt task for executing shell commands.", |
---|
4 | "version": "0.4.2", |
---|
5 | "homepage": "https://github.com/jharding/grunt-exec", |
---|
6 | "author": { |
---|
7 | "name": "Jake Harding", |
---|
8 | "email": "jacob.s.harding@gmail.com" |
---|
9 | }, |
---|
10 | "repository": { |
---|
11 | "type": "git", |
---|
12 | "url": "git://github.com/jharding/grunt-exec.git" |
---|
13 | }, |
---|
14 | "bugs": { |
---|
15 | "url": "https://github.com/jharding/grunt-exec/issues" |
---|
16 | }, |
---|
17 | "licenses": [ |
---|
18 | { |
---|
19 | "type": "MIT", |
---|
20 | "url": "https://github.com/jharding/grunt-exec/blob/master/LICENSE-MIT" |
---|
21 | } |
---|
22 | ], |
---|
23 | "main": "Gruntfile.js", |
---|
24 | "engines": { |
---|
25 | "node": ">=0.8.0" |
---|
26 | }, |
---|
27 | "scripts": { |
---|
28 | "test": "/usr/bin/env node test/test.js" |
---|
29 | }, |
---|
30 | "peerDependencies": { |
---|
31 | "grunt": "~0.4" |
---|
32 | }, |
---|
33 | "devDependencies": { |
---|
34 | "grunt": "~0.4", |
---|
35 | "grunt-contrib-jshint": "~0.1" |
---|
36 | }, |
---|
37 | "keywords": [ |
---|
38 | "grunt", |
---|
39 | "gruntplugin", |
---|
40 | "shell" |
---|
41 | ], |
---|
42 | "readme": "[](http://travis-ci.org/jharding/grunt-exec)\ngrunt-exec\n==========\n\nGrunt plugin for executing shell commands.\n\nInstallation\n------------\n\nInstall grunt-exec using npm:\n\n```\n$ npm install grunt-exec\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 automatically 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, grunt-exec will assume an error has occurred and will abort grunt immediately.\n\n[types_of_tasks]: https://github.com/gruntjs/grunt/blob/master/docs/types_of_tasks.md#multi-tasks\n\n### Properties\n\n* __command__: The shell command to be executed. Must be a string or a function that returns a string. (alias: __cmd__)\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 directory containing your Gruntfile.\n* __exitCode__: The expected exit code, task will fail if the actual exit code doesn't match. Defaults to `0`.\n* __callback__: The callback function passed `child_process.exec`. Defaults to a noop.\n\n### Command Functions\n\nIf you plan on doing advanced stuff with grunt-exec, you'll most likely be using functions for the `command` property of your exec targets. This section details a couple of helpful tips about command functions that could help make your life easier.\n\n#### Passing arguments from the command line\n\nCommand functions can be called with arbitrary arguments. Let's say we have the following 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 `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 are 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 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 with 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\nCopyright (c) 2012 [Jake Harding](http://thejakeharding.com) \nLicensed under the MIT License.\n", |
---|
43 | "readmeFilename": "README.md", |
---|
44 | "_id": "grunt-exec@0.4.2", |
---|
45 | "dist": { |
---|
46 | "shasum": "021f0dddaeef00cc4d83dff9d0d8c47a64917dbd" |
---|
47 | }, |
---|
48 | "_from": "grunt-exec@0.4.2", |
---|
49 | "_resolved": "https://registry.npmjs.org/grunt-exec/-/grunt-exec-0.4.2.tgz" |
---|
50 | } |
---|