Paul says lookup PATH
Works both with trailing slash `c:\nodejs\` and without it `c:\nodejs`
This commit is contained in:
parent
6aa6bdebe6
commit
91a3e12ab0
1 changed files with 6 additions and 10 deletions
|
@ -6,11 +6,6 @@ import sys
|
||||||
|
|
||||||
|
|
||||||
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
|
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
|
||||||
WINDOWS_NODE_PATHs = [
|
|
||||||
'C:/Program Files/nodejs/node.exe',
|
|
||||||
'C:/Program Files (x86)/nodejs/node.exe',
|
|
||||||
'C:/nodejs/node.exe',
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -22,8 +17,7 @@ def main():
|
||||||
if sys.platform in ['win32', 'cygwin']:
|
if sys.platform in ['win32', 'cygwin']:
|
||||||
node = find_node()
|
node = find_node()
|
||||||
if not node:
|
if not node:
|
||||||
print 'Node.js is required for building atom-shell at paths:\n' + \
|
print 'Node.js not found in PATH for building atom-shell'
|
||||||
'\n'.join(WINDOWS_NODE_PATHs)
|
|
||||||
return 1
|
return 1
|
||||||
subprocess.check_call(['node', coffee, '-c', '-o', output_dir, input_file],
|
subprocess.check_call(['node', coffee, '-c', '-o', output_dir, input_file],
|
||||||
executable=node)
|
executable=node)
|
||||||
|
@ -32,9 +26,11 @@ def main():
|
||||||
|
|
||||||
|
|
||||||
def find_node():
|
def find_node():
|
||||||
for path in WINDOWS_NODE_PATHs:
|
PATHs = os.environ['PATH'].split(os.pathsep)
|
||||||
if os.path.exists(path):
|
for path in PATHs:
|
||||||
return path
|
full_path = os.path.join(path, 'node.exe')
|
||||||
|
if os.path.exists(full_path):
|
||||||
|
return full_path
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue