forked from KevinJump/uSync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
40 lines (27 loc) · 980 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
/// <binding ProjectOpened='default' />
const { watch, src, dest } = require('gulp');
const sourceFolders = [
'uSync8.BackOffice/App_Plugins/',
'uSync8.HistoryView/App_Plugins/'];
const destination = 'uSync8.Site/App_Plugins/';
function copy(path, baseFolder) {
return src(path, { base: baseFolder })
.pipe(dest(destination));
}
function time() {
return '[' + new Date().toISOString().slice(11, -5) + ']';
}
exports.default = function () {
sourceFolders.forEach(function (sourceFolder) {
let source = sourceFolder + '**/*';
watch(source, { ignoreInitial: false })
.on('change', function (path, stats) {
console.log(time(), path, sourceFolder, 'changed');
copy(path, sourceFolder);
})
.on('add', function (path, stats) {
console.log(time(), path, sourceFolder, 'added');
copy(path, sourceFolder);
});
});
};