Joined July 2018
·

Luis Lobo

Posted to Simple Gulp Copy file task over 1 year ago

I use:

// copyTo.js v1
function copyTo(files, dest) {
if (typeof files == 'string') {
files = [files];
};
gulp.src(files).pipe(gulp.dest(dest));
console.log(cliDate() + ' copyTo success');
};

// cliDate.js v1
function cliDate() {
let date = new Date(),
hours = date.getHours(),
minutes = date.getMinutes(),
seconds = date.getSeconds();
hours < 10 ? hours = '0' + hours : hours;
minutes < 10 ? minutes = '0' + minutes : minutes;
seconds < 10 ? seconds = '0' + seconds : seconds;
return '[' + hours + ':' + minutes + ':' + seconds + ']';
};

Achievements
1 Karma
0 Total ProTip Views