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

boxcli: don't print help w/ shell non-zero exit code #38

Merged
merged 1 commit into from
Aug 30, 2022

Conversation

gcurtis
Copy link
Collaborator

@gcurtis gcurtis commented Aug 29, 2022

Summary

Don't print an error message or the usage help when devbox shell exits with a non-zero code. We still want to propagate the shell's exit code in order to support scripts.

Before:

$ devbox shell
Installing nix packages. This may take a while...
Starting a devbox shell...
$ exit 1
Usage:
  devbox shell [<dir>] [flags]

Flags:
  -h, --help   help for shell

After:

$ devbox shell
Installing nix packages. This may take a while...
Starting a devbox shell...
$ exit 1
$ echo $?
1

How was it tested?

  • Running devbox shell and exiting 1 to check there's no error output.
  • Removing nix from my PATH and running devbox shell to check I still see an error.

Don't print an error message or the usage help when `devbox shell` exits
with a non-zero code. We still want to propagate the shell's exit code
in order to support scripts.

Before:

	$ devbox shell
	Installing nix packages. This may take a while...
	Starting a devbox shell...
	$ exit 1
	Usage:
	  devbox shell [<dir>] [flags]

	Flags:
	  -h, --help   help for shell

After:

	$ devbox shell
	Installing nix packages. This may take a while...
	Starting a devbox shell...
	$ exit 1
	$ echo $?
	1
Copy link
Contributor

@loreto loreto left a comment

Choose a reason for hiding this comment

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

LGTM

@gcurtis gcurtis merged commit e749a56 into main Aug 30, 2022
@gcurtis gcurtis deleted the shell-exit-code branch August 30, 2022 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants