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

Infer shells automatically, and use versions based on the current working directory (optional) #68

Merged
merged 7 commits into from
Mar 4, 2019

Conversation

Schniz
Copy link
Owner

@Schniz Schniz commented Feb 25, 2019

Add the ability to use on every pwd change (bash, zsh). Also, infers shell type automatically. Fixes #20

Thanks @yardnsm for the zsh snippet!

Note: in order to use it, everyone who uses fnm needs to add double-quotes around the "env":

- eval `fnm env --multi`
+ eval "`fnm env --multi --use-on-cd`"

for Fish we moved to use source instead of eval:

- eval (fnm env --multi)
+ fnm env --multi --use-on-cd | source

@Schniz Schniz self-assigned this Feb 25, 2019
@Schniz Schniz added the PR: New Feature A new feature was added label Feb 25, 2019

alias cd=__fnmcd
|}
| Fish => {|
Copy link
Owner Author

Choose a reason for hiding this comment

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

Hey @elliottsj! do you want to take a look? I know it works - but do you think this is a good way to do it on fish?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good to me! It's a little beyond my expertise, but from a cursory Google search, --on-variable PWD seems like a great way to do this.


alias cd=__fnmcd
|}
| Fish => {|
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good to me! It's a little beyond my expertise, but from a cursory Google search, --on-variable PWD seems like a great way to do this.

@Schniz Schniz changed the title Automatically use versions based on the current working directory (optional) Infer shells automatically, and use versions based on the current working directory (optional) Feb 28, 2019
@Schniz Schniz merged commit dc9c9ea into master Mar 4, 2019
@Schniz Schniz deleted the add-use-on-cd branch March 4, 2019 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: New Feature A new feature was added
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants