Rewrite compile-coffee script in python.
This commit is contained in:
parent
85d7e7b034
commit
5c48f03dfe
4 changed files with 33 additions and 24 deletions
23
script/compile-coffee.py
Executable file
23
script/compile-coffee.py
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/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])
|
||||
|
||||
node = get_node_path()
|
||||
coffee = os.path.join(SOURCE_ROOT, 'node_modules', '.bin', 'coffee')
|
||||
subprocess.check_call([node, coffee, '-c', '-o', output_dir, input_file])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
Loading…
Add table
Add a link
Reference in a new issue