Skip to content

Commit

Permalink
Clean up pull request.
Browse files Browse the repository at this point in the history
  • Loading branch information
jharding committed May 24, 2013
1 parent 8d33077 commit bfeee0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ If the exit code generated by the specified shell command is greater than 0, gru
* __command__: The shell command to be executed. Must be a string or a function that returns a string. (alias: __cmd__)
* __stdout__: If `true`, stdout will be printed. Defaults to `true`.
* __stderr__: If `true`, stderr will be printed. Defaults to `true`.
* __cwd__: Current working directory of the shell command. Defaults to Gruntfile location directory.
* __cwd__: Current working directory of the shell command. Defaults to the directory containing your Gruntfile.

### Command Functions

Expand Down Expand Up @@ -129,5 +129,5 @@ For more information on semantic versioning, please visit http://semver.org/.
License
-------

Copyright (c) 2012 [Jake Harding](http://thejakeharding.com)
Copyright (c) 2012 [Jake Harding](http://thejakeharding.com)
Licensed under the MIT License.
6 changes: 3 additions & 3 deletions tasks/exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ module.exports = function(grunt) {
grunt.registerMultiTask('exec', 'Execute shell commands.', function() {
var data = this.data
, o = {
stdout: data.stdout !== undefined ? data.stdout : true
cwd: data.cwd
, stdout: data.stdout !== undefined ? data.stdout : true
, stderr: data.stderr !== undefined ? data.stderr : true
}
, command
, cpopts = data.cwd && {cwd: data.cwd}
, childProcess
, args = [].slice.call(arguments, 0)
, done = this.async();
Expand All @@ -42,7 +42,7 @@ module.exports = function(grunt) {
}

verbose.subhead(command);
childProcess = cp.exec(command, cpopts);
childProcess = o.cwd ? cp.exec(command, { cwd: o.cwd }) : cp.exec(command);

o.stdout && childProcess.stdout.on('data', function (d) { log.write(d); });
o.stderr && childProcess.stderr.on('data', function (d) { log.error(d); });
Expand Down

0 comments on commit bfeee0c

Please sign in to comment.