Skip to content

Commit

Permalink
add script to generate zip files suitable for releases
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaspleyer committed May 30, 2024
1 parent eb7f0f6 commit eeada25
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import os
from pathlib import Path
import argparse
import zipfile
import glob

def zip_package():
# Get all files which should be included
typst_files = glob.glob("./*.typ")
typst_files.append("./typst.toml")
typst_files.append("./LICENSE")

# Open new zip file
zip_file = zipfile.ZipFile(Path("package.zip"), mode='w')
for p in typst_files:
zip_file.write(p)

if __name__ == "__main__":
parser = argparse.ArgumentParser(
prog="Releaser",
description="Generate release files for the package and templates",
)
parser.add_argument('-p', '--package', action='store_true')
parser.add_argument('-t', '--template')

args = parser.parse_args()

if args.package:
zip_package()

0 comments on commit eeada25

Please sign in to comment.