Skip to content

Commit d451fb5

Browse files
committed
Adds customizable node path #19
1 parent 1a44c95 commit d451fb5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

jsfmt.sublime-settings

+1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@
2727
"type": "double"
2828
}
2929
},
30+
"node-path": "node",
3031
"alert-errors": true
3132
}

node_bridge.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
import os
22
import platform
33
from subprocess import Popen, PIPE
4+
import sublime
45

56
IS_OSX = platform.system() == 'Darwin'
67
IS_WINDOWS = platform.system() == 'Windows'
8+
SETTINGS_FILE = 'jsfmt.sublime-settings'
79

810
def node_bridge(data, bin, cdir, args=[]):
11+
settings = sublime.load_settings(SETTINGS_FILE)
12+
print(settings.get('node-path'))
913
env = None
1014
if IS_OSX:
1115
# GUI apps in OS X doesn't contain .bashrc/.zshrc set paths
1216
env = os.environ.copy()
1317
env['PATH'] += ':/usr/local/bin'
1418
try:
15-
p = Popen(['node', bin] + args,
19+
p = Popen([settings.get('node-path', 'node'), bin] + args,
1620
stdout=PIPE, stdin=PIPE, stderr=PIPE,
1721
cwd=cdir, env=env, shell=IS_WINDOWS)
1822
except OSError:

0 commit comments

Comments
 (0)