Comparing version 0.0.3 to 1.0.0
18
index.js
@@ -6,15 +6,23 @@ /*jshint node:true */ | ||
var es = require('event-stream'), | ||
gutil = require('gulp-util'), | ||
path = require('path'), | ||
exec = require('child_process').exec; | ||
module.exports = function(command){ | ||
module.exports = function(command, opt){ | ||
if (!command) { | ||
throw new Error('command is blank'); | ||
} | ||
// defaults | ||
if (!opt) { | ||
opt = { | ||
silent: false | ||
}; | ||
} | ||
return es.map(function (file, cb){ | ||
var filepath = path.resolve(file.path); | ||
var cmd = command.replace(/\$file/g, filepath); | ||
opt.file = file; | ||
var cmd = gutil.template(command, opt); | ||
exec(cmd, function (error, stdout, stderr) { | ||
if (stderr) { | ||
console.log(stderr); | ||
gutil.log(stderr); | ||
} | ||
@@ -25,3 +33,3 @@ if (stdout) { | ||
if (stdout) { | ||
console.log(stdout); | ||
gutil.log(stdout); | ||
} | ||
@@ -28,0 +36,0 @@ cb(error, file); |
{ | ||
"name": "gulp-exec", | ||
"description": "exec plugin for gulp", | ||
"version": "0.0.3", | ||
"version": "1.0.0", | ||
"homepage": "https://github.com/robrich/gulp-exec", | ||
@@ -13,3 +13,4 @@ "repository": "git://github.com/robrich/gulp-exec.git", | ||
"dependencies": { | ||
"event-stream": "*" | ||
"event-stream": "*", | ||
"gulp-util":"~1.2.0" | ||
}, | ||
@@ -16,0 +17,0 @@ "devDependencies": { |
@@ -15,6 +15,8 @@  | ||
gulp.task('reset', function() { | ||
gulp.files('./**/**').pipe(exec('git checkout $file')); | ||
gulp.src('./**/**').pipe(exec('git checkout <%= file.path %>')); | ||
}); | ||
``` | ||
Note this now uses `gulp-util` for templating, a breaking change from previous versions. | ||
LICENSE | ||
@@ -21,0 +23,0 @@ ------- |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4374
33
0
46
2
+ Addedgulp-util@~1.2.0
+ Addedansi-styles@0.2.0(transitive)
+ Addedchalk@0.3.0(transitive)
+ Addedgulp-util@1.2.0(transitive)
+ Addedhas-color@0.1.7(transitive)
+ Addedlodash._escapehtmlchar@2.4.1(transitive)
+ Addedlodash._escapestringchar@2.4.1(transitive)
+ Addedlodash._htmlescapes@2.4.1(transitive)
+ Addedlodash._isnative@2.4.1(transitive)
+ Addedlodash._objecttypes@2.4.1(transitive)
+ Addedlodash._reinterpolate@2.4.1(transitive)
+ Addedlodash._reunescapedhtml@2.4.1(transitive)
+ Addedlodash._shimkeys@2.4.1(transitive)
+ Addedlodash.defaults@2.4.1(transitive)
+ Addedlodash.escape@2.4.1(transitive)
+ Addedlodash.isobject@2.4.1(transitive)
+ Addedlodash.keys@2.4.1(transitive)
+ Addedlodash.template@2.4.1(transitive)
+ Addedlodash.templatesettings@2.4.1(transitive)
+ Addedlodash.values@2.4.1(transitive)
+ Addedminimist@0.0.10(transitive)
+ Addedoptimist@0.6.1(transitive)
+ Addedwordwrap@0.0.3(transitive)