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 + ']'; };
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 + ']';
};