I have
D1
SD1
SD2
SD3
dist
I want to copy all directories under D1 (except dist) to dist. Obviously I can't copy dist to dist otherwise it will be recursive indefinitely.
This is my code
gulp.task('extras', () => {
return gulp.src([
'**/*',
'!dist/**'], {
dot: true
}).pipe(gulp.dest('dist'));
});
and it says
events.js:141
throw er; // Unhandled 'error' event
^
Error: EISDIR: illegal operation on a directory, read
at Error (native)