Skip to content

Instantly share code, notes, and snippets.

@philmander
Created July 3, 2014 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philmander/7e44b0049c4dfbc3154c to your computer and use it in GitHub Desktop.
Save philmander/7e44b0049c4dfbc3154c to your computer and use it in GitHub Desktop.
Litlle function for concatenating file names in gulp
//little util to do tidier directory concatenation
function dir() {
var args = Array.prototype.slice.call(arguments);
var prefix = "";
if(args[0] === "!") {
prefix = args[0];
args.shift();
}
return prefix + args.join("/");
}
//usage
var dirs = {
js: "./src"
};
gulp.src(dir(dirs.js, '**/*.js'));
gulp.src(dir("!", dirs.js, '**/*.js'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment