forked from KevinJump/uSync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
old-gulpfile.js
34 lines (27 loc) · 939 Bytes
/
old-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
/// <binding ProjectOpened='default' />
const { watch, src, dest } = require('gulp');
const sourceFolders = [
'uSync.BackOffice.Assets/App_Plugins/'
];
const destination = 'uSync.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);
});
});
};