grunt-exec
Advanced tools
Comparing version 0.4.5 to 0.4.6
{ | ||
"name": "grunt-exec", | ||
"description": "Grunt task for executing shell commands.", | ||
"version": "0.4.5", | ||
"version": "0.4.6", | ||
"homepage": "https://github.com/jharding/grunt-exec", | ||
@@ -28,3 +28,3 @@ "author": { | ||
"scripts": { | ||
"test": "/usr/bin/env node test/test.js" | ||
"test": "node test/test.js" | ||
}, | ||
@@ -31,0 +31,0 @@ "peerDependencies": { |
@@ -158,3 +158,3 @@ [](http://travis-ci.org/jharding/grunt-exec) | ||
Copyright (c) 2012 [Jake Harding](http://thejakeharding.com) | ||
Copyright (c) 2012-2014 [Jake Harding](http://thejakeharding.com) | ||
Licensed under the MIT License. |
@@ -16,3 +16,3 @@ // grunt-exec | ||
var data = this.data | ||
, execOptions = {} | ||
, execOptions = data.options !== undefined ? data.options : {} | ||
, stdout = data.stdout !== undefined ? data.stdout : true | ||
@@ -59,2 +59,9 @@ , stderr = data.stderr !== undefined ? data.stderr : true | ||
// Catches failing to execute the command at all (eg spawn ENOENT), | ||
// since in that case an 'exit' event will not be emitted. | ||
childProcess.on('error', function (err) { | ||
log.error(f('Failed with: %s', err)); | ||
done(false); | ||
}); | ||
childProcess.on('exit', function(code) { | ||
@@ -61,0 +68,0 @@ if (exitCodes.indexOf(code) < 0) { |
@@ -5,6 +5,6 @@ module.exports = function(grunt) { | ||
test1: { | ||
cmd: 'echo "bruce willis was dead" > test1' | ||
cmd: 'echo bruce willis was dead> test1' | ||
} | ||
, test2: { | ||
cmd: function() { return 'echo "grunt@' + this.version + '" > test2'; } | ||
cmd: function() { return 'echo grunt@' + this.version + '> test2'; } | ||
} | ||
@@ -16,5 +16,5 @@ , test3: { | ||
, 'thoughts on tacos? ' + tacoThoughts | ||
].join('\n'); | ||
].join(', '); | ||
return 'echo "' + text + '" > test3'; | ||
return 'echo ' + text + '> test3'; | ||
} | ||
@@ -24,3 +24,3 @@ } | ||
cmd: function(){ | ||
return 'echo "you can use callback, and error, stdout, stderr can be used as arguments"'; | ||
return 'echo you can use callback, and error, stdout, stderr can be used as arguments'; | ||
} | ||
@@ -44,3 +44,3 @@ , callback: function(error, stdout, stderr){ | ||
} | ||
, test7: 'echo "you don\'t even need an object" > test7' | ||
, test7: 'echo you do not even need an object> test7' | ||
} | ||
@@ -47,0 +47,0 @@ }); |
var grunt = require('grunt') | ||
, lf = grunt.util.linefeed | ||
, path = require('path') | ||
@@ -19,15 +20,15 @@ , fs = require('fs') | ||
var tests = [ | ||
{ name: 'test1', expected: 'bruce willis was dead\n' } | ||
, { name: 'test2' , expected: 'grunt@' + grunt.version + '\n' } | ||
{ name: 'test1', expected: 'bruce willis was dead' + lf } | ||
, { name: 'test2' , expected: 'grunt@' + grunt.version + lf } | ||
, { | ||
name: 'test3' | ||
, expected: [ | ||
'the answer to life is 42', 'thoughts on tacos? love', '' | ||
].join('\n') | ||
'the answer to life is 42', 'thoughts on tacos? love' | ||
].join(', ') + lf | ||
} | ||
, { | ||
name: 'test4' | ||
, expected:'you can use callback, and error, stdout, stderr can be used as arguments\n' | ||
, expected:'you can use callback, and error, stdout, stderr can be used as arguments' + lf | ||
} | ||
, { name: 'test7', expected: 'you don\'t even need an object\n' } | ||
, { name: 'test7', expected: 'you do not even need an object' + lf } | ||
] | ||
@@ -34,0 +35,0 @@ , outputPath; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
12551
210