-
-
Save ilguzin/c6681447ac8e5554c6b5708c4a160b5e to your computer and use it in GitHub Desktop.
Sublime Text 3: Apply NVM environment
This file contains hidden or 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment