-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgulpfile.js
47 lines (31 loc) · 1009 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/// <binding ProjectOpened='default' />
const { watch, src, dest } = require('gulp');
const sources = [
'uSync.Migration.Packers.Shared/App_Plugins'
];
const destinations = [
'MigrationPackers.v8.Site/App_Plugins/',
'MigrationPackers.v7.Site/App_Plugins/'
];
function copy(path, base) {
destinations.forEach(function (target) {
console.log(time(), path.substring(base.length + 1), '>', target.substring(0, target.indexOf('/')));
src(path, { base: base })
.pipe(dest(target));
});
}
function time() {
return '[' + new Date().toISOString().slice(11, -5) + ']';
}
exports.default = function () {
sources.forEach(function (source) {
var searchPath = source + '/**/*';
watch(searchPath, { ignoreInitial: false })
.on('change', function (path, stats) {
copy(path, source);
})
.on('add', function (path, stats) {
copy(path, source);
});
});
};