]> khamidou — GitHub mirrors - electron.git/commitdiff
Add wrapper script for coffeelint.
authorCheng Zhao <zcbenz@gmail.com>
Fri, 27 Sep 2013 02:49:55 +0000 (10:49 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 27 Sep 2013 02:49:55 +0000 (10:49 +0800)
script/cibuild
script/coffeelint.py [new file with mode: 0755]

index eb3aca82f7529cacca7bed88c4b63dd32f3fd139..7a6bbf97576aa9182f3759ac57a5c30cf5c7dc3a 100755 (executable)
@@ -12,6 +12,7 @@ def main():
   run_script('bootstrap.py')
   run_script('cpplint.py')
   run_script('pylint.py')
+  run_script('coffeelint.py')
   run_script('build.py')
   run_script('test.py', ['--ci'])
   run_script('create-dist.py')
diff --git a/script/coffeelint.py b/script/coffeelint.py
new file mode 100755 (executable)
index 0000000..2e912d6
--- /dev/null
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+
+import glob
+import os
+import subprocess
+import sys
+
+
+SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
+
+
+def main():
+  os.chdir(SOURCE_ROOT)
+
+  coffeelint = os.path.join(SOURCE_ROOT, 'node_modules', 'coffeelint', 'bin',
+                            'coffeelint')
+  files = glob.glob('browser/api/lib/*.coffee') + \
+          glob.glob('renderer/api/lib/*.coffee') + \
+          glob.glob('common/api/lib/*.coffee') + \
+          glob.glob('browser/atom/*.coffee')
+
+  if sys.platform in ['win32', 'cygwin']:
+    subprocess.check_call(['node', coffeelint] + files,
+                          executable='C:/Program Files/nodejs/node.exe')
+  else:
+    subprocess.check_call(['node', coffeelint] + files)
+
+
+if __name__ == '__main__':
+  sys.exit(main())