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

fix: add ctrl+c 130 listener #445

Merged
merged 2 commits into from
Nov 10, 2023
Merged

fix: add ctrl+c 130 listener #445

merged 2 commits into from
Nov 10, 2023

Conversation

WillieRuemmele
Copy link
Contributor

@W-14406056@

src/sfCommand.ts Outdated
@@ -345,6 +345,9 @@ export abstract class SfCommand<T> extends Command {
}

public async _run<R>(): Promise<R> {
process.on('SIGINT', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ref: https://nodejs.org/api/process.html, scroll down to Signal events

while we're here, does it make sense to handle the other handleable things (SIGTERM, SIGBREAK and possibly SIGHUP for windows?)

@mshanemc
Copy link
Contributor

QA: compiled this code to /lib and then copied that into the CLI's corresponding file

ran sf plugins (oclif) and sf org list (sfCommand),
✅ no issues

let's ctrl-c something

➜  sf-plugins-core git:(wr/exitCode) sf org list 
^C
➜  sf-plugins-core git:(wr/exitCode) echo $? 
130
➜  sf-plugins-core git

Not tested: the other signals.

@mshanemc mshanemc merged commit 6b005cb into main Nov 10, 2023
16 of 40 checks passed
@mshanemc mshanemc deleted the wr/exitCode branch November 10, 2023 19:14
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.

None yet

2 participants