win: Fix calling lint scripts with win32 python.
This commit is contained in:
parent
336908eba0
commit
724b29d6d4
3 changed files with 9 additions and 15 deletions
|
@ -3,33 +3,27 @@
|
||||||
import errno
|
import errno
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import subprocess
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from lib.util import execute
|
||||||
|
|
||||||
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
|
|
||||||
|
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
os.chdir(SOURCE_ROOT)
|
os.chdir(SOURCE_ROOT)
|
||||||
|
|
||||||
coffeelint = os.path.join(SOURCE_ROOT, 'node_modules', 'coffeelint', 'bin',
|
coffeelint = os.path.join(SOURCE_ROOT, 'node_modules', '.bin', 'coffeelint')
|
||||||
'coffeelint')
|
if sys.platform in ['win32', 'cygwin']:
|
||||||
|
coffeelint += '.cmd'
|
||||||
settings = ['--quiet', '-f', os.path.join('script', 'coffeelint.json')]
|
settings = ['--quiet', '-f', os.path.join('script', 'coffeelint.json')]
|
||||||
files = glob.glob('atom/browser/api/lib/*.coffee') + \
|
files = glob.glob('atom/browser/api/lib/*.coffee') + \
|
||||||
glob.glob('atom/renderer/api/lib/*.coffee') + \
|
glob.glob('atom/renderer/api/lib/*.coffee') + \
|
||||||
glob.glob('atom/common/api/lib/*.coffee') + \
|
glob.glob('atom/common/api/lib/*.coffee') + \
|
||||||
glob.glob('atom/browser/atom/*.coffee')
|
glob.glob('atom/browser/atom/*.coffee')
|
||||||
|
|
||||||
try:
|
execute([coffeelint] + settings + files)
|
||||||
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__':
|
if __name__ == '__main__':
|
||||||
sys.exit(main())
|
sys.exit(main())
|
||||||
|
|
2
script/cpplint.py
vendored
2
script/cpplint.py
vendored
|
@ -23,7 +23,7 @@ IGNORE_FILES = [
|
||||||
os.path.join('atom', 'common', 'swap_or_assign.h'),
|
os.path.join('atom', 'common', 'swap_or_assign.h'),
|
||||||
]
|
]
|
||||||
|
|
||||||
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
|
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
|
@ -5,7 +5,7 @@ import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
|
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
Loading…
Reference in a new issue