-
Notifications
You must be signed in to change notification settings - Fork 64
/
gulpfile.js
40 lines (30 loc) · 1010 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 sources = [
'./Jumoo.uSync.BackOffice/App_Plugins',
'./Jumoo.uSync.Content/App_Plugins',
'./Jumoo.uSync.Complete/App_Plugins',
'./Jumoo.uSync.Snapshots/App_Plugins'
];
const destination = './Jumoo.uSync.Site/App_Plugins';
function copy(path, base) {
return src(path, { base: base })
.pipe(dest(destination));
}
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) {
console.log(time(), path, 'changed');
copy(path, source);
})
.on('add', function (path, stats) {
console.log(time(), path, 'added');
copy(path, source);
});
});
};