]> khamidou — GitHub mirrors - electron.git/commitdiff
Fix calling node in coffeelint.
authorCheng Zhao <zcbenz@gmail.com>
Mon, 3 Mar 2014 11:50:32 +0000 (19:50 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 3 Mar 2014 11:50:32 +0000 (19:50 +0800)
script/coffeelint.py

index 8bfd402bc4f825926a481e1bc897601f12686af8..9ca3330b229c139c474e7e91920dd2d13b31143d 100755 (executable)
@@ -20,11 +20,14 @@ def main():
           glob.glob('common/api/lib/*.coffee') + \
           glob.glob('browser/atom/*.coffee')
 
-  if sys.platform in ['win32', 'cygwin']:
-    subprocess.check_call(['node', coffeelint] + settings + files,
-                          executable='C:/Program Files/nodejs/node.exe')
-  else:
+  try:
     subprocess.check_call(['node', coffeelint] + settings + files)
+  except OSError as e:
+    if e.errno == errno.ENOENT and sys.platform in ['win32', 'cygwin']:
+      subprocess.check_call(['node', coffeelint] + settings + files,
+                            executable='C:/Program Files/nodejs/node.exe')
+    else:
+      raise
 
 
 if __name__ == '__main__':