Skip to content
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

Handle SIGNINT (CTRL+C) #154

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

klaaspieter
Copy link

I keep killing the server using CTRL+C because that's how I kill pretty much any other long-running CLI task (rails server, brew update, xcodebuild, etc)

Doing so in Publish keeps the Python process active. This handles the SIGINT signal, terminates the server and then kills the CLI.

The signal handling code was taken from SPM.
See: https://github.com/swiftlang/swift-package-manager/blob/80b1e179bef19e6eb71b0d20b2cb471053ae1b2c/Sources/Basics/Cancellator.swift#L70-L96

I keep killing the server using CTRL+C because that's how I kill pretty
much any other long-running CLI task (rails server, brew update,
xcodebuild, etc)

Doing so in Publish keeps the Python process active. This handles the
SIGINT signal, terminates the server and then kills the CLI.

The signal handling code was taken from SPM.
See: https://github.com/swiftlang/swift-package-manager/blob/80b1e179bef19e6eb71b0d20b2cb471053ae1b2c/Sources/Basics/Cancellator.swift#L70-L96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant