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

allow optional appendment to shell configurations #2410

Closed
xenoterracide opened this issue Jan 13, 2021 · 7 comments
Closed

allow optional appendment to shell configurations #2410

xenoterracide opened this issue Jan 13, 2021 · 7 comments
Labels
installing nvm Problems installing nvm itself

Comments

@xenoterracide
Copy link

I'm using zinit to install nvm, zinit allows things to be run lazily and can execute scripts, and load/unload completions, as well as keep track of them. I am also using yadm, yadm manages dotfiles, so the zshrc that's being modified is actually just a copy of a template that may later be overwritten. It'd be nice if I could run the installer without writing to my ~/.zshrc

@ljharb ljharb added the installing nvm Problems installing nvm itself label Jan 13, 2021
@ljharb
Copy link
Member

ljharb commented Jan 13, 2021

I'm not familiar with any of those tools, and please note that nvm is 100% unsupported unless you use the install script in the readme.

You can set PROFILE=/dev/null when running the install script, and it won't attempt to write to a profile file, but then you'll have to source nvm.sh on your own.

@ljharb ljharb closed this as completed Jan 13, 2021
@xenoterracide
Copy link
Author

xenoterracide commented Jan 14, 2021 via email

@ljharb
Copy link
Member

ljharb commented Jan 14, 2021

It is already configurable, by setting the PROFILE env var to /dev/null, as I explained.

@xenoterracide
Copy link
Author

sorry, I missed that... somehow... mah bad. But now I'm using that and it's not adding the lines, I'm only executing nvm.sh, but somehow I'm still getting completions, not that I don't want completions, but I'm rather perplexed. deleted my nvm dir, deleted ~/.zinit, and exited my terminal, just to be sure all of the in memory stuff and cached configs and whatever were cleared out. still there.

oh I see, I have a plugin already installed that's already loading some completions for nvm, not sure if they're a direct copy from here or not, but kinda good that I'm no longer loading both.

@jvzaniolo
Copy link

@xenoterracide can you paste your solution to work with zinit?

@xenoterracide
Copy link
Author

Uh.... I have no idea anymore... But you can check out xenoterracide/dotfiles . Also zinit is dead you should look at the z-shell repos for zi Which is just a copy to an organization.

milesfrain added a commit to milesfrain/nvm that referenced this issue Apr 25, 2023
I had to dig into nvm-sh#2410 to learn about the `PROFILE=/dev/null` technique to install without appending to my shell config. Figured this note would be good to add in the main installation docs.
Also added a note on how to do this as a one-liner which was not obvious for me.
@milesfrain
Copy link
Contributor

For reference here's a one-liner for installing nvm without appending to shell config:

PROFILE=/dev/null bash -c 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash'

Created #3100 to add this to readme.

ljharb pushed a commit to milesfrain/nvm that referenced this issue May 6, 2023
I had to dig into nvm-sh#2410 to learn about the `PROFILE=/dev/null` technique to install without appending to my shell config. Figured this note would be good to add in the main installation docs.
Also added a note on how to do this as a one-liner which was not obvious for me.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installing nvm Problems installing nvm itself
Projects
None yet
Development

No branches or pull requests

4 participants