question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use exit to pass exit code

See original GitHub issue

Would it be possible to pass an exit code to the call to AppContext’s exit function? Then you’d get the value with const code = await app.waitUntilExit() and verify it’s correct during testing.

I’d be willing to PR this.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sindresorhuscommented, Mar 18, 2019

Ink users can set process.exitCode themselves. We could document this as it’s not well-known.

0reactions
mAAdhaTTahcommented, Mar 18, 2019

Yeah, to make it clear, I don’t want Ink to call process.exit itself. I do want to provide a way to signal the results of the CLI run, specifically in unit tests, that would allow me to bootstrap & run the app and assert against the results. The error-passing mechanism seems good and I can take a crack at that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chapter 6. Exit and Exit Status
The exit command terminates a script, just as in a C program. · Every command returns an exit status (sometimes referred to as...
Read more >
Understanding Exit Codes and Using them in Bash scripts
On Unix and Linux systems, programs can pass a value to their parent process while terminating. This value is referred to as an...
Read more >
Linux and Unix exit code tutorial with examples - George Ornbo
To set an exit code in a script use exit 0 where 0 is the number you want to return. In the following...
Read more >
Pass through exit status code after using - Unix Stack Exchange
Pass through exit status code after using ||​​ Show activity on this post. I want to do a different operation that has the...
Read more >
Returning information from a shell script via an Exit Code
Exit codes are a number between 0 and 255, which is returned by any Unix command when it returns control to its parent...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found