-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
32 lines (23 loc) · 775 Bytes
/
gulpfile.js
File metadata and controls
32 lines (23 loc) · 775 Bytes
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
/// <binding ProjectOpened='default' />
const { watch, src, dest } = require('gulp');
const sourceFolder = './uSyncExample.Data/App_Plugins/';
const source = sourceFolder + '**/*';
const destination = './uSyncExample.Site/App_Plugins/';
function copy(path) {
return src(path, { base: sourceFolder })
.pipe(dest(destination));
}
function time() {
return '[' + new Date().toISOString().slice(11, -5) + ']';
}
exports.default = function () {
watch(source, { ignoreInitial: false })
.on('change', function (path, stats) {
console.log(time(), path, 'changed');
copy(path);
})
.on('add', function (path, stats) {
console.log(time(), path, 'added');
copy(path);
});
};