Closed JakeJP closed 9 years ago
Thanks for raising this. I have just released 0.7.1 which I believe will fix this issue - can you please confirm as I'm not completely clear what your setup is?
Thanks for your quick response. I confirmed that problem is fixed in a single task. But fix is sill halfway. My project is a little more complicated.
project/
|-- gulpfile.js (contains task A, B, C)
|-- subproject
|-- gulpfile.js (contains task S )
hub([ './subproject/gulpfile.js' ]);
gulp.task( 'A', ['S'], function(){ return ...; } ); // depending on S
gulp.task( 'B', funcion(){ return ...; } ); // simple task not using callback
gulp.task( 'C', function(){ return ...; } ); // simple task not using callback
gulp.task( 'all', ['A','B','C'] );
...
Task A completes without problem by the fix this time. (thanks)
Task 'all' misses some files because of the same cwd issue. I guess it's because tasks are running parallel and multiple processes are recycled between and before after task A,B,C...
Yes I don't think there is a way to solve that if the tasks are run in parallel. Gulp4 will make it easier to run them in series, but until then you could use 'run-sequence' to run them I suppose.
Ok. I understood. run-sequence is a good alternative for my case.
gulp.task( 'all', function(cb){
runSequence('A', [ B', 'C' ], cb);
});
works perfect for me. Thanks.
I understand process.chdir for the subfile is neccesary to run properly. But problem goes like this:
Is there any chance to get cwd back for the parent task to continue after finishing tasks in submodules?
My current workaround is just put chdir on the top of every task function.