Compose full list in one place
This commit is contained in:
parent
5137e16485
commit
0ab4475f24
1 changed files with 2 additions and 3 deletions
|
@ -9,7 +9,7 @@ SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
|
||||||
WINDOWS_NODE_PATHs = [
|
WINDOWS_NODE_PATHs = [
|
||||||
'C:/Program Files/nodejs',
|
'C:/Program Files/nodejs',
|
||||||
'C:/Program Files (x86)/nodejs',
|
'C:/Program Files (x86)/nodejs',
|
||||||
]
|
] + os.environ['PATH'].split(os.pathsep)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
input_file = sys.argv[1]
|
input_file = sys.argv[1]
|
||||||
|
@ -29,8 +29,7 @@ def main():
|
||||||
|
|
||||||
|
|
||||||
def find_node():
|
def find_node():
|
||||||
PATHs = WINDOWS_NODE_PATHs + os.environ['PATH'].split(os.pathsep)
|
for path in WINDOWS_NODE_PATHs:
|
||||||
for path in PATHs:
|
|
||||||
full_path = os.path.join(path, 'node.exe')
|
full_path = os.path.join(path, 'node.exe')
|
||||||
if os.path.exists(full_path):
|
if os.path.exists(full_path):
|
||||||
return full_path
|
return full_path
|
||||||
|
|
Loading…
Reference in a new issue