Created
July 16, 2015 13:45
-
-
Save smoli/cab31ca5b0028c950aa2 to your computer and use it in GitHub Desktop.
Gulp - Update local dependencies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require("gulp"); | |
var del = require("del"); | |
var run = require("gulp-run"); | |
var packageInfo = require("./package.json"); | |
var localDeps = Object.keys(packageInfo.dependencies).filter(function(name) { | |
return !!packageInfo.dependencies[name].match(/^\.+.*/); | |
}); | |
gulp.task("delete-local-dependencies", function(cb) { | |
del(localDeps.map(function(dep) { | |
return "./node_modules/" + dep | |
}), cb) | |
}); | |
gulp.task("npm-install", function() { | |
run('npm install').exec() | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment