Created
March 21, 2016 07:53
-
-
Save lethee/5587ff14c570c8af756c to your computer and use it in GitHub Desktop.
Sublime Text 3: Apply NVM environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Save this file | |
# mac - "~/Library/Application Support/Sublime Text 3/Packages/" | |
# linux - "~/.config/sublime-text-3/Packages/" | |
# NOTE! | |
# ~/.nvm/alias/default must contain full version name. | |
# $ nvm alias default v4.3.5 | |
import os | |
home = os.environ['HOME'] | |
with open("%s/.nvm/alias/default" % home) as nvm_default_file: | |
nvm_default_contents = nvm_default_file.read().strip() | |
path = "%s/.nvm/versions/node/%s/bin" % (home, nvm_default_contents) | |
path = path + ":" + os.environ['PATH'] | |
os.environ['PATH'] = path |
Use
nvm alias default v10.11.0
Then nvm_default_contents will contain v char
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the script. I had to change the script to match node folders on my system:
Additional
v
as prefix for node version folder inline 14
: