| OLD | NEW |
| 1 # Copyright 2011 Google Inc. All Rights Reserved. | 1 # Copyright 2011 Google Inc. All Rights Reserved. |
| 2 | 2 |
| 3 import os | 3 import os |
| 4 import shutil | 4 import shutil |
| 5 import stat | 5 import stat |
| 6 import sys | 6 import sys |
| 7 | 7 |
| 8 HOME = os.path.dirname(os.path.realpath(__file__)) | 8 HOME = os.path.dirname(os.path.realpath(__file__)) |
| 9 # TODO(ngeoffray): does not work on Windows. | |
| 10 HOME = os.path.join(HOME, os.pardir, os.pardir) | 9 HOME = os.path.join(HOME, os.pardir, os.pardir) |
| 11 | 10 |
| 12 sys.path.append(HOME) | 11 sys.path.append(HOME) |
| 13 import frog | 12 import frog |
| 14 | 13 |
| 15 def main(args): | 14 def main(args): |
| 16 for arg in args: | 15 for arg in args: |
| 17 index = arg.find('--js_out=') | 16 index = arg.find('--js_out=') |
| 18 if index != -1: | 17 if index != -1: |
| 19 js_out = arg[9:len(arg)]; | 18 js_out = arg[9:len(arg)]; |
| 20 | 19 |
| 21 exit_code = 0 | 20 # TODO(ngeoffray): Compile frogsh without checks integrated. |
| 22 if js_out.find('Release') != -1: | 21 # if js_out.find('Release') != -1: |
| 23 exit_code = frog.main(args) | 22 exit_code = frog.main(args) |
| 24 else: | |
| 25 shutil.copy(os.path.join(HOME, 'scripts', 'bootstrap', 'frog_wrapper.py'), | |
| 26 js_out) | |
| 27 if exit_code: | 23 if exit_code: |
| 28 return exit_code | 24 return exit_code |
| 25 |
| 29 os.chmod(js_out, stat.S_IXUSR | stat.S_IXGRP | stat.S_IRUSR | | 26 os.chmod(js_out, stat.S_IXUSR | stat.S_IXGRP | stat.S_IRUSR | |
| 30 stat.S_IRGRP | stat.S_IWUSR) | 27 stat.S_IRGRP | stat.S_IWUSR) |
| 31 return exit_code | 28 return exit_code |
| 32 | 29 |
| 33 | 30 |
| 34 if __name__ == '__main__': | 31 if __name__ == '__main__': |
| 35 sys.exit(main(sys.argv)) | 32 sys.exit(main(sys.argv)) |
| OLD | NEW |