Copyglob task implemented

dependabot/npm_and_yarn/BuildServer/eslint-7.2.0
Inga 🏳‍🌈 9 years ago
parent 9bd132398d
commit ba166f7d6a
  1. 39
      BuildServer/lib/tasks/copyglob.js

@ -0,0 +1,39 @@
"use strict";
var fse = require('fs-extra');
var glob = require('glob');
module.exports = function (params, processor) {
return {
process: function () {
glob(params.mask, {
dot: true,
cwd: processor.context.exported
}, function (err, files) {
if (err) {
processor.onError(err);
return processor.done();
}
if (!files || !files.length) {
return processor.done();
}
return processor.processTask({
type: "parallel",
params: {
tasks: files.map(function (file) {
return {
name: file,
type: "copy",
params: {
filename: file
}
};
})
}
}, processor.done.bind(processor));
});
}
};
};
Loading…
Cancel
Save