Changeset 516 for Dev/trunk/node_modules/grunt-exec/README.md
- Timestamp:
- 03/14/14 12:36:58 (11 years ago)
- Location:
- Dev/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk
- Property svn:ignore
-
old new 1 1 build 2 quod-erat.git
-
- Property svn:ignore
-
Dev/trunk/node_modules/grunt-exec/README.md
r484 r516 23 23 ----- 24 24 25 This plugin is a [multi task][types_of_tasks], meaning that grunt will automatically iterate over all exec targets if a target is not specified. 25 This plugin is a [multi task][types_of_tasks], meaning that grunt will 26 automatically iterate over all exec targets if a target is not specified. 26 27 27 If 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. 28 If the exit code generated by the specified shell command is greater than 0, 29 grunt-exec will assume an error has occurred and will abort grunt immediately. 28 30 29 [types_of_tasks]: http s://github.com/gruntjs/grunt/blob/master/docs/types_of_tasks.md#multi-tasks31 [types_of_tasks]: http://gruntjs.com/configuring-tasks#task-configuration-and-targets 30 32 31 33 ### Properties 32 34 33 * __command__: The shell command to be executed. Must be a string or a function that returns a string. (alias: __cmd__) 34 * __stdout__: If `true`, stdout will be printed. Defaults to `true`. 35 * __stderr__: If `true`, stderr will be printed. Defaults to `true`. 36 * __cwd__: Current working directory of the shell command. Defaults to the directory containing your Gruntfile. 37 * __exitCode__: The expected exit code, task will fail if the actual exit code doesn't match. Defaults to `0`. 38 * __callback__: The callback function passed `child_process.exec`. Defaults to a noop. 35 * __command__ (alias: __cmd__): The shell command to be executed. Must be a 36 string or a function that returns a string. 37 * __stdout__: If `true`, stdout will be printed. Defaults to `true`. 38 * __stderr__: If `true`, stderr will be printed. Defaults to `true`. 39 * __cwd__: Current working directory of the shell command. Defaults to the 40 directory containing your Gruntfile. 41 * __exitCode__ (alias: __exitCodes__): The expected exit code(s), task will 42 fail if the actual exit code doesn't match. Defaults to `0`. Can be an array 43 for multiple allowed exit codes. 44 * __callback__: The callback function passed `child_process.exec`. Defaults to 45 a noop. 46 47 If the configuration is instead a simple `string`, it will be 48 interpreted as a full command itself: 49 50 ```javascript 51 exec: { 52 echo_something: 'echo "This is something"' 53 } 54 ``` 39 55 40 56 ### Command Functions 41 57 42 If 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. 58 If you plan on doing advanced stuff with grunt-exec, you'll most likely be using 59 functions for the `command` property of your exec targets. This section details 60 a couple of helpful tips about command functions that could help make your life 61 easier. 43 62 44 63 #### Passing arguments from the command line 45 64 46 Command functions can be called with arbitrary arguments. Let's say we have the following exec target that echoes a formatted name: 65 Command functions can be called with arbitrary arguments. Let's say we have the 66 following exec target that echoes a formatted name: 47 67 48 68 ```javascript … … 61 81 ``` 62 82 63 In order to get `SIMPSON, HOMER` echoed, you'd run `grunt exec:echo_name:homer:simpson` from the command line. 83 In order to get `SIMPSON, HOMER` echoed, you'd run 84 `grunt exec:echo_name:homer:simpson` from the command line. 64 85 65 86 ### Accessing `grunt` object 66 87 67 All 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`. 88 All command functions are called in the context of the `grunt` object that they 89 are being ran with. This means you can access the `grunt` object through `this`. 68 90 69 91 ### Example … … 82 104 cmd: 'ls -l **' 83 105 }, 106 list_all_files: 'ls -la', 84 107 echo_grunt_version: { 85 108 cmd: function() { return 'echo ' + this.version; } … … 117 140 ---------- 118 141 119 For transparency and insight into the release cycle, releases will be numbered with the follow format: 142 For transparency and insight into the release cycle, releases will be numbered 143 with the follow format: 120 144 121 145 `<major>.<minor>.<patch>`
Note: See TracChangeset
for help on using the changeset viewer.