Skip to content

Instantly share code, notes, and snippets.

@macobo
Forked from joesepi/node_env.py
Last active November 5, 2016 12:35
Show Gist options
  • Select an option

  • Save macobo/381cfe7e4a737e198c9d to your computer and use it in GitHub Desktop.

Select an option

Save macobo/381cfe7e4a737e198c9d to your computer and use it in GitHub Desktop.
Sublime 3 package NVM node path configuration for linux
import os
import getpass
user = getpass.getuser()
nvm_default_file_path = '/home/macobo/.nvm/alias/default'
with open(nvm_default_file_path, 'r') as content_file:
content = content_file.read()
version = content.strip()
path = ''.join([
"/home/%(user)s/.nvm/v%(version)s/bin:",
"/home/%(user)s/.nvm/v%(version)s/lib:",
]) % {'version':version, 'user':user}
os.environ["PATH"] = path + os.environ["PATH"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment