Skip to content

Commit

Permalink
Add more exclude patterns in typst.toml. Add package script
Browse files Browse the repository at this point in the history
  • Loading branch information
quachpas committed Oct 6, 2024
1 parent feacc54 commit bdc3485
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
9 changes: 9 additions & 0 deletions package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
# package all files except the ones mentioned in exclude list in typst.toml

exclude_patterns=$(awk '/exclude = \[/,/\]/ {if ($0 !~ /exclude = \[/ && $0 !~ /\]/) print $0}' typst.toml | sed 's/[",]//g' | sed 's/^[ \t]*//')
tar_args=$(while IFS= read -r line; do echo " --exclude=$line"; done <<<"$exclude_patterns")
version=$(awk '/version =/ {print $3}' typst.toml | sed 's/"//g')
tar_args+=" --exclude-vcs-ignores -czf ../glossarium-$version.tar.gz ."
tar $tar_args
tar -tf ../glossarium-$version.tar.gz
15 changes: 12 additions & 3 deletions typst.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@ description = "Glossarium is a simple, easily customizable typst glossary."
repository = "https://github.com/typst-community/glossarium"
exclude = [
"tbump.toml",
"examples/*",
"makefile",
"flake.nix",
"flake.lock",
"justfile",
"examples",
"package.sh",
"tests",
".gitignore",
".github/*",
"advanced-docs",
"docs",
".github",
".vscode",
".gtm",
".git",
".gitignore",
"**/*.pdf",
]

0 comments on commit bdc3485

Please sign in to comment.