-
Notifications
You must be signed in to change notification settings - Fork 16
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: Improve CLI #82
fix: Improve CLI #82
Conversation
Signed-off-by: Edgar Gomes <talktoedgar@gmail.com>
Signed-off-by: Edgar Gomes <talktoedgar@gmail.com>
Signed-off-by: Edgar Gomes <talktoedgar@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one comment but generally LGTM
|
||
trap 'handle_error' ERR | ||
PARENT_SHELL=$(ps -o comm= -p $PPID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont think this method of shell detection is reliable/universal, e.g. will fail on busybox systems (e.g. alpine) and will also error out in a docker environment i think since $PPID will be 0, but maybe thats an optimization for another time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this also incorrectly detects my shell as -zsh
instead of zsh
since i am in a login shell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have a more concrete example? I've tested on different docker containers (and the bash one is alpine):
docker container run -it --rm dideler/fish-shell
docker container run -it --rm bash
docker container run -it --rm zshusers/zsh:5.9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the case for -zsh
.
Merging as it is and we can improve it from this point.
🤖 I have created a release *beep* *boop* --- ## [0.1.10](0.1.9...0.1.10) (2024-08-08) ### Features * copy button for code blocks in docs ([#103](#103)) ([be8bdde](be8bdde)), closes [#89](#89) * match fonts and gradients to new blog theme ([#107](#107)) ([0938dc3](0938dc3)) ### Bug Fixes * allow external links in docs ([#101](#101)) ([701928f](701928f)), closes [#87](#87) * Improve CLI ([#82](#82)) ([42c1b69](42c1b69)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
No description provided.