-
-
Save joesepi/11269417 to your computer and use it in GitHub Desktop.
Updated python script to manage nvm and ST3 pathing for OSX
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
# Sublime package NVM node path configuration | |
# Save this file in: | |
# ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/node_env.py | |
import os | |
os.environ["PATH"] = "/Users/YOUR_USERNAME/.nvm/v0.10.26/bin:/Users/cranemes/.nvm/v0.10.26/lib:/Users/YOUR_USERNAME/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" | |
print("PATH=" + os.environ["PATH"]) |
epok75 I'm using oh-my-zsh and I think I have the right conversion but it isn't working for me still.
I put a node_env.sublime-build
in /Users/{user}/Library/Application Support/Sublime Text 3/Packages/User
with this in it:
{
"shell_cmd": "zsh -c \"source ~/.nvm/nvm.sh && nvm run default $file\"",
"selector": "source.js",
}
Sublime still tells me:
env: node: No such file or directory
Any ideas? The docs for zsh say:
-c Take the first argument as a command to execute, rather than reading commands from a script or
standard input. If any further arguments are given, the first one is assigned to $0, rather than
being used as a positional parameter.
looks similar to me how bash works.
@davidhq worked
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just threw this updated version in my ST3 to enable TernJS. Using Linux, and not having "node" but "6" as my default alias, this works well (not supporting local .nvmrc, I was just interested in having a working TernJS):