mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-23 04:45:21 +00:00
fix: ensure that the lockfile is respected (#2000)
This commit is contained in:
parent
bd688f354e
commit
c3fa0c5cb2
17 changed files with 372 additions and 63 deletions
|
|
@ -34,6 +34,31 @@ def run_tests(test_files=None):
|
|||
subprocess.run(command, check=True)
|
||||
|
||||
|
||||
def prepare():
|
||||
bookdir = os.environ.get("BOOKDIR", "/home/runner/dev/workspaces/book")
|
||||
if not os.path.exists(bookdir):
|
||||
print(f"Book directory {bookdir} does not exist.")
|
||||
sys.exit(1)
|
||||
|
||||
# compile
|
||||
compile_command = [
|
||||
"tinymist",
|
||||
"compile",
|
||||
"--lockfile",
|
||||
os.path.join(bookdir, "tinymist.lock"),
|
||||
os.path.join(bookdir, "main.typ"),
|
||||
os.path.join(bookdir, "book.pdf"),
|
||||
]
|
||||
|
||||
try:
|
||||
subprocess.run(compile_command, check=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"Compilation failed: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
print("Compilation completed successfully.")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Check if any test files are provided as command line arguments
|
||||
if len(sys.argv) > 1:
|
||||
|
|
@ -41,4 +66,5 @@ if __name__ == "__main__":
|
|||
else:
|
||||
test_files = None
|
||||
|
||||
prepare()
|
||||
run_tests(test_files)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue