Closed SillyFreak closed 3 weeks ago
I think storing the list of directories and files in the script itself may unnecessarily complicate the process of adding more should the package author need to.
Would it be possible to set those in a dot file with a format like .gitignore?
I was a bit hasty with submitting; now there's a bit more context in the original PR message.
The two factors that influenced my reasoning:
a dot file would probably be better, but I don't really look forward to implementing the filtering in bash...
I'll give it a go tomorrow when I have a moment, but yeah the reasoning behind my request was relating to some packages possibly needing to also ship a gallery folder (or whatever)
Edit: perhaps something like this? https://stackoverflow.com/a/73082137
I'll try it out!
some preliminary playing around indicates that that script doesn't work as intended; using -name
for matching only uses the basename (last name in the path), so ignoring something like docs/*.typ
wouldn't work. replacing with -path
also doesn't just work because ignoring .github
doesn't ignore the files in there. Also, -path
can match foo/bar
with f*
, i.e. *
also matches /
which is not intuitive.
I'll try some more.
ok, I managed to do something. I called the ignore file .typstignore
, not sure if that's a good name. The file contains a short description what is supported. I tested the script superficially; the negated patterns seem to work and file names/patterns with spaces don't seem to make problems. Even file names with asterisks, and patterns with escaped asterisks seem to work!
A second pair of eyes that properly looks at the code would definitely be a good idea, though.
<3
This PR adds two scripts adapted from CeTZ (Apache 2.0): https://github.com/johannes-wolf/cetz/blob/35c0868378cea5ad323cc0d9c2f76de8ed9ba5bd/scripts/package
The files that are included in packaging are those that are either necessary for the package, or are likely to be linked in the README, meaning links to them on Universe should work:
src/
typst.toml
README.md
LICENSE
docs/manual.pdf
CHANGELOG.md