--
This commit is contained in:
parent
24f3d27984
commit
6b60015c02
9588 changed files with 1149251 additions and 49 deletions
21
node_modules/gulp-flatten/index.js
generated
vendored
Normal file
21
node_modules/gulp-flatten/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
var path = require('path');
|
||||
var through2 = require('through2');
|
||||
var flattenPath = require('./lib/flatten-path');
|
||||
var PluginError = require('gulp-util').PluginError;
|
||||
|
||||
module.exports = function(opts) {
|
||||
opts = opts || {};
|
||||
opts.newPath = opts.newPath || '';
|
||||
|
||||
return through2.obj(function(file, enc, next) {
|
||||
if (!file.isDirectory()) {
|
||||
try {
|
||||
file.path = path.join(file.base, opts.newPath, flattenPath(file, opts));
|
||||
this.push(file);
|
||||
} catch (e) {
|
||||
this.emit('error', new PluginError('gulp-flatten', e));
|
||||
}
|
||||
}
|
||||
next();
|
||||
});
|
||||
};
|
||||
Loading…
Reference in a new issue