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

Print version on use #12

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

rmccue
Copy link
Contributor

@rmccue rmccue commented Jul 6, 2017

This outputs the version you've just switched to, which is handy when you've used an alias.

Native nvm also prints the npm version, I decided not to bother here just for brevity's sake, but it would only require adding " (npm v" (npm --version 2>/dev/null) ")" to it, after checking that npm exists.

@brigand
Copy link
Owner

brigand commented Jul 6, 2017

It's common to put a nvm use in config.fish, and this would cause it to log every time you open a shell. If there's some way to only make it happen in interactive use, I'd accept that.,

@rmccue
Copy link
Contributor Author

rmccue commented Jul 6, 2017

Sure, I'll take a look at updating it.

It shouldn't actually be required to nvm use in your config.fish though, because fish_user_paths is universal (and persisted automatically) unless I'm missing something?

@brigand
Copy link
Owner

brigand commented Jul 6, 2017

For some reason, it doesn't work for me on my new computer. I had to edit the script to do set -g fish_user_paths ... for it to work at all.

@rmccue
Copy link
Contributor Author

rmccue commented Jul 6, 2017

Updated, uses status to check if it's currently in the login process.

Strange re: -g, is it possible you didn't have fish_user_paths set up as a universal variable beforehand? 🤔

@rmccue
Copy link
Contributor Author

rmccue commented Jul 6, 2017

Whoops, status --is-login doesn't do what I thought it did. Don't merge for now :)

@brigand
Copy link
Owner

brigand commented Jul 6, 2017

Tried set -u fish_user_paths, removed the -g and opened a new window. It's not working. The -g is harmless, right? Also we don't want it to be shared by all sessions.

@rmccue
Copy link
Contributor Author

rmccue commented Jul 6, 2017

Updated to use a more accurate test. Unfortunately, the startup status isn't exposed to us except in the stack trace, so it has to do a status --print-stack-trace and grep it, which is a bit nasty.

No idea on the user paths, but I can confirm it's working for me.

@brigand
Copy link
Owner

brigand commented Jul 6, 2017

Ready to merge?

@Clee681
Copy link

Clee681 commented Jul 28, 2017

FWIW, I removed the -g flag, and it works in new shells without the corresponding line in my config.fish file.

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.

None yet

3 participants