| 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 HOME = os.path.join(HOME, os.pardir, os.pardir) | 9 HOME = os.path.join(HOME, os.pardir, os.pardir) |
| 10 | 10 |
| 11 sys.path.append(HOME) | 11 END_SCRIPT = ''' |
| 12 import frog | 12 VM = '%s' |
| 13 if __name__ == '__main__': |
| 14 sys.exit(main(sys.argv)) |
| 15 ''' |
| 13 | 16 |
| 14 def main(args): | 17 def main(args): |
| 15 js_out = args[1] | 18 product_dir = args[1] |
| 19 vm = os.path.join(product_dir, 'dart') |
| 20 frog = os.path.join(product_dir, 'frog', 'bin', 'frog') |
| 16 | 21 |
| 17 # TODO(ngeoffray): Create a script that will run the VM in production mode. | 22 # TODO(ngeoffray): Create a script that will run the VM in production mode. |
| 18 # if js_out.find('Release') != -1: | 23 # if js_out.find('Release') != -1: |
| 19 shutil.copy(os.path.join(HOME, 'scripts', 'bootstrap', 'frog_wrapper.py'), | 24 shutil.copy(os.path.join(HOME, 'scripts', 'bootstrap', 'frog_wrapper.py'), |
| 20 js_out) | 25 frog) |
| 21 os.chmod(js_out, stat.S_IXUSR | stat.S_IXGRP | stat.S_IRUSR | | 26 |
| 27 with open(frog, 'a+') as f: |
| 28 f.write(END_SCRIPT % vm) |
| 29 |
| 30 os.chmod(frog, stat.S_IXUSR | stat.S_IXGRP | stat.S_IRUSR | |
| 22 stat.S_IRGRP | stat.S_IWUSR) | 31 stat.S_IRGRP | stat.S_IWUSR) |
| 23 return 0 | 32 return 0 |
| 24 | 33 |
| 25 | 34 |
| 26 if __name__ == '__main__': | 35 if __name__ == '__main__': |
| 27 sys.exit(main(sys.argv)) | 36 sys.exit(main(sys.argv)) |
| OLD | NEW |