Skip to content

Commit

Permalink
pass environment on to subprocess (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
PixnBits committed Jan 26, 2015
1 parent df79a54 commit 463d34d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
8 changes: 8 additions & 0 deletions cli.py
Expand Up @@ -10,6 +10,7 @@
import sublime
import os
import subprocess
import copy

if os.name == 'nt':
LOCAL_PATH = ';' + os.getenv('APPDATA') + '\\npm'
Expand Down Expand Up @@ -43,8 +44,15 @@ def execute(self, command, cwd):
# see http://stackoverflow.com/a/1254322/2770309
if os.name != 'nt':
command = " ".join(command)

# copy our extra places to look (#16)
environ = copy.copy(os.environ)
environ['PATH'] += LOCAL_PATH
#print("environ[PATH]: "+environ['PATH'])

proc = subprocess.Popen(command,
shell=True,
env=environ,
cwd=cwd,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
Expand Down
3 changes: 2 additions & 1 deletion messages.json
@@ -1,4 +1,5 @@
{
"install": "README.md",
"0.0.7": "messages/0.0.7.txt"
"0.0.7": "messages/0.0.7.txt",
"0.0.8": "messages/0.0.8.txt"
}
6 changes: 6 additions & 0 deletions messages/0.0.8.txt
@@ -0,0 +1,6 @@
Enhancements
============

Bug Fixes
=========
npm can't find node when `os.environ['PATH']` is changed from sublime's default (#16)

0 comments on commit 463d34d

Please sign in to comment.