-
-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gulp does not wait for gulpfile.js to complete when SIGTERM is sent to gulp-cli #222
Comments
@sttk Can you help here? I'm not sure what is being requested. |
Yes, I'll address this weekend. |
@KleptoKat I suppose your aim in this issue is to make enable to run post-tasks of a watch task and finish them normally by gulp-cli when CTRL+C is entered. And I changed your code as follows. Does this fit your aim?
|
@phated Should we implement the solution for this issue? The solution would be like the following:
|
@sttk I think making the change you suggest is out of scope. People have all the flexibility of node at their disposal and can even hook into the watcher instance if they need to (we return Chokidar from |
@phated Got it. |
What were you expecting to happen?
When I click CTRL+C, a sigterm is sent to gulp. I have created a watcher which spawns a child_process when anything under
src/**
is triggered. to ensure that the instance has fully exited before we restart a new instance. My instance has some async cleanup (~50 ms). I've added anexitHandle
for SIGINT and SIGTERM handler to my gulpfile.js to prevent the process from exiting immediately. When this completes properly, there are some console logs, and then the user should be given the terminal after a short delay.What actually happened?
Gulpfile completes, but gulp-cli has exited. This results in losing the current process losing the terminal input. (eg
KleptoKat@Computer:~/app$
) with the console outputs after this line. It requires an extra enter keypress which is not a huge deal but it's a little annoying.Please give us a sample of your gulpfile
Here is a smaller gulpfile:
Terminal output / screenshots
When CTRL C is entered:
Please provide the following information:
node -v
): v10.16.3npm -v
): 6.9.0gulp -v
): CLI 2.2, local 4.0.2I can help provide a more replicable environment if need be. It's just slightly annoying. A possible fix may be to add an argument, like --waitForGulpfileToExit which will enable this kind of waiting behaviour.
The text was updated successfully, but these errors were encountered: