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: Improve CLI #82

Merged
merged 13 commits into from
Aug 7, 2024
Merged

fix: Improve CLI #82

merged 13 commits into from
Aug 7, 2024

Conversation

lostbean
Copy link
Contributor

@lostbean lostbean commented Aug 5, 2024

No description provided.

Copy link
Contributor

@skylarmb skylarmb left a 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)
Copy link
Contributor

@skylarmb skylarmb Aug 6, 2024

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?

Copy link
Contributor

@skylarmb skylarmb Aug 6, 2024

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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.

@lostbean lostbean merged commit 42c1b69 into main Aug 7, 2024
13 checks passed
h4ck3rk3y pushed a commit that referenced this pull request Aug 8, 2024
🤖 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).
@lostbean lostbean deleted the egomes/improve-cli branch September 4, 2024 19:17
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.

2 participants