Have been using gulp to do batch operations on different folders on Mac, with a shell script stacks several gulp tasks in sequence, e.g.:
gulp custom_task /path/a
gulp custom_task /path/b
everything works smoothly on Mac, but when I try to the same on Windows, the batch file created on windows only executed whatever the first gulp command line in the .bat file and exit completely. Don't know the root cause, also tried to use start/wait, e.g.:
start/wait gulp custom_task /path/a
start/wait gulp custom_task /path/b
but since "start" opens a new window and gulp exits on the new window without closing it, I have to manually close the window to make the batch continue, makes the batch no longer automated. So need help to get either a fix or a walkaround to make it working on Winodws!
Fixed myself: gulp is considered a batch file itself when run in Windows (file: gulp.cmd). so need to use 'call' infront, basically,
call gulp custom_task /path/a
call gulp custom_task /path/a
Thank you Fiery ! Was searching why and your post give the perfect answer.
I ran into a problem where gulp needed admin rights. Running a bat file as admin sets it's working folder to windows\system32. This fixed it:
pushd %~dp0
call gulp myGulpCommand
Most helpful comment
Fixed myself: gulp is considered a batch file itself when run in Windows (file: gulp.cmd). so need to use 'call' infront, basically,
call gulp custom_task /path/a
call gulp custom_task /path/a