You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
 
 

30 lines
626 B

  1. import os
  2. import sys
  3. import shutil
  4. import subprocess
  5. def main():
  6. dev = "--dev" in sys.argv
  7. werror = "--werror" in sys.argv
  8. clean = "--clean" in sys.argv
  9. if dev:
  10. program = "sphinx-autobuild"
  11. else:
  12. program = "sphinx-build"
  13. opts = []
  14. if clean:
  15. if os.path.exists("build"):
  16. shutil.rmtree("build")
  17. if werror:
  18. opts.append("-W")
  19. cmd = [program, *opts, "-d", "build", "-b", "html", "source", "build/html"]
  20. print("$", *cmd)
  21. process = subprocess.run(cmd)
  22. if process.returncode != 0:
  23. sys.exit(1)
  24. if __name__ == "__main__":
  25. main()