electron/script/compile-coffee.py
Cheng Zhao 979ec05ed3 [Win] Fix running node from python.
There is a mysterious "WindowsError [error 5] Access is denied" error is
the "executable" is not specified under Windows.
2013-08-16 16:28:45 +08:00

26 lines
672 B
Python
Executable file

#!/usr/bin/env python
import os
import subprocess
import sys
from lib.util import *
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
def main():
input_file = sys.argv[1]
output_dir = os.path.dirname(sys.argv[2])
coffee = os.path.join(SOURCE_ROOT, 'node_modules', 'coffee-script', 'bin',
'coffee')
if sys.platform in ['win32', 'cygwin']:
subprocess.check_call(['node', coffee, '-c', '-o', output_dir, input_file],
executable='C:/Program Files/nodejs/node.exe')
else:
subprocess.check_call(['node', coffee, '-c', '-o', output_dir, input_file])
if __name__ == '__main__':
sys.exit(main())