您不能選擇超過 %s 個話題 話題必須以字母或數字為開頭,可包含連接號 ('-') 且最長為 35 個字
此存儲庫已封存,您能瀏覽檔案及複製此存儲庫,但不能推送、建立問題及拉取請求。
 
 
 
 
 
 

22 行
532 B

  1. from path import Path
  2. import sys
  3. import subprocess
  4. def main():
  5. template = Path("build.in.ninja").text()
  6. to_write = template
  7. for md_file in Path(".").files("*.md"):
  8. to_write += f"build {md_file.with_suffix('.pdf')}: pandoc ../{md_file}\n"
  9. build_path = Path("build")
  10. build_path.mkdir_p()
  11. out = build_path / "build.ninja"
  12. out.write_text(to_write)
  13. process = subprocess.run(["ninja", "-C", build_path])
  14. if process.returncode != 0:
  15. sys.exit(1)
  16. if __name__ == "__main__":
  17. main()