pull_and_build_html.py 496 B

1234567891011121314151617181920212223
  1. #!/usr/bin/python
  2. import optparse
  3. import os
  4. def run(cmd):
  5. rc = os.system(cmd)
  6. if rc != 0:
  7. raise Exception('"%s" failed with exit code %d' % (cmd, rc))
  8. def main(out):
  9. run('git pull')
  10. run('./build.py --out="%s" --set-version html' % out)
  11. parser = optparse.OptionParser(
  12. description='Pull repo and build html page',
  13. usage='%prog <output directory>'
  14. )
  15. (options, args) = parser.parse_args()
  16. if len(args) != 1:
  17. parser.print_help();
  18. exit(-1)
  19. main(args[0])