-
-
Couldn't load subscription status.
- Fork 4.2k
Description
What were you expecting to happen?
To run 3 tasks in sequence, the first one is just to run a build command, the second one will delete a folder and it's content, the third one will copy files from a source into a destination (which was the deleted folder).
So basically the tasks definition is as following :
gulp.task('build-files, function(cb) {
runSequence('run-build-cmd',
'delete-dest', 'copy-files',
cb);
});
gulp.task('delete-dest', (cb) => {
del([pathToDestFolder], {force: true});
cb();
});
gulp.task('copy-files', () => {
return gulp.src(pathToSrcFolder)
.pipe(gulp.dest(pathToDestFolder))
.pipe(gulp.dest(anotherPath));
});
This task will run whenever changes happened in the source folder as following :
gulp.watch(pathToSrcFolder, ['build-files']);
When I run the
gulp delete-destin cmd prompt (which will clear thepathToDestFolder) and then gulp copy-files (which will copy the source folder into two folderspathToDestFolderandanotherPath) it works as expected .So I guess runSequence didn't work as expected ?
I tried to use
rimrafinstead ofdel, and all seems to work just fine, I know thatrimrafis depricated, and it's better to usedelinstead, but whydelin this case results in an exception ?
What actually happened?
Error was thrown:
internal/streams/legacy.js:59
throw er; // Unhandled stream error in pipe.
^
Error: ENOENT: no such file or directory, chmod 'pathToDestFolder\path\to\some\file\file.ext'
What version of gulp are you using?
3.9.1
What versions of npm and node are you using?
npm -v & node -v
5.6.0
v8.9.4