From 6e079d8bc45d50848f9155cc3c2c7daa8c2909b1 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 17 Dec 2013 13:14:54 +0800 Subject: [PATCH] Also search C:/Program Files (x86) for node binary. --- script/compile-coffee.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/script/compile-coffee.py b/script/compile-coffee.py index 5fbb956..179931a 100755 --- a/script/compile-coffee.py +++ b/script/compile-coffee.py @@ -6,6 +6,10 @@ import sys 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', +] def main(): @@ -15,11 +19,22 @@ def main(): coffee = os.path.join(SOURCE_ROOT, 'node_modules', 'coffee-script', 'bin', 'coffee') if sys.platform in ['win32', 'cygwin']: + node = find_node() + if not node: + print 'Node.js is required for building atom-shell' + return 1 subprocess.check_call(['node', coffee, '-c', '-o', output_dir, input_file], - executable='C:/Program Files/nodejs/node.exe') + executable=node) else: subprocess.check_call(['node', coffee, '-c', '-o', output_dir, input_file]) +def find_node(): + for path in WINDOWS_NODE_PATHs: + if os.path.exists(path): + return path + return None + + if __name__ == '__main__': sys.exit(main()) -- 2.7.4