2013-09-27 02:49:55 +00:00
|
|
|
#!/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')
|
2013-09-27 03:01:40 +00:00
|
|
|
settings = ['--quiet', '-f', os.path.join('script', 'coffeelint.json')]
|
2013-09-27 02:49:55 +00:00
|
|
|
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']:
|
2013-09-27 03:01:40 +00:00
|
|
|
subprocess.check_call(['node', coffeelint] + settings + files,
|
2013-09-27 02:49:55 +00:00
|
|
|
executable='C:/Program Files/nodejs/node.exe')
|
|
|
|
else:
|
2013-09-27 03:01:40 +00:00
|
|
|
subprocess.check_call(['node', coffeelint] + settings + files)
|
2013-09-27 02:49:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
sys.exit(main())
|