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

Support different shells #18

Merged
merged 3 commits into from
Feb 19, 2024
Merged

Support different shells #18

merged 3 commits into from
Feb 19, 2024

Conversation

dzvon
Copy link
Contributor

@dzvon dzvon commented Feb 7, 2024

As a fish shell user, I've found that our project currently only supports the bash style (export X=Y) of setting environment variables when I use the -env option. The purpose of this PR is to support other common shells.

How to determine which type of shell to use for exporting commands that set environment variables?

  1. You can use the -shell option to specify the shell type you want explicitly.
  2. If -shell is not provided, then use the current user's default shell type, which is we can read from the SHELL environment variable.

I don't think you'll need provide the -shell option in most cases, unless you're manually entering a shell different from the default, which is rare, and this is the only reason the -shell option exist.

Any thoughts? @theplant/sre @bodhi Thank you! :)

@dzvon dzvon requested a review from a team February 7, 2024 23:28
Copy link
Member

@bodhi bodhi left a comment

Choose a reason for hiding this comment

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

Good stuff, thanks @dzvon!

Copy link
Contributor

@idealhack idealhack left a comment

Choose a reason for hiding this comment

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

Thanks for adding support for other shells!

Don't fail if the shell is not recognized, just use the export command
keeping the previous behavior.
@dzvon dzvon merged commit 79c565b into master Feb 19, 2024
2 checks passed
@dzvon dzvon deleted the support-different-shells branch February 20, 2024 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants