1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-23 12:52:10 +00:00

Switch soem things from find -exec to xargs

Allows better filtering and doesn't supress exit codes. Since I'm no
longer supressing exit codes, I had to handle them properly in
copy-file-to-xhtml.sh by using if-statements.

This also allowed me to skip the generation of an XHTML redirect page.
This commit is contained in:
Rohan Kumar 2023-11-26 15:12:35 -08:00
parent 6487c5c7f3
commit 866ca1b386
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
2 changed files with 7 additions and 3 deletions

View file

@ -128,7 +128,7 @@ xhtmlize:
.PHONY: copy-to-xhtml
copy-to-xhtml:
find $(OUTPUT_DIR) -type f -name "*.html" -exec sh scripts/copy-file-to-xhtml.sh {} \;
find $(OUTPUT_DIR) -type f -name "*.html" | grep -v 'resume/index.html' | xargs -n1 sh scripts/copy-file-to-xhtml.sh
.PHONY: deploy-html
deploy-html:

View file

@ -9,5 +9,9 @@ html_file="$1"
xhtml_file="${html_file%*.html}.xhtml"
cp -p "$html_file" "$xhtml_file"
[ -f "$html_file.gz" ] && cp -p "$html_file.gz" "$xhtml_file.gz"
[ -f "$html_file.br" ] && cp -p "$html_file.br" "$xhtml_file.br"
if [ -f "$html_file.gz" ]; then
cp -p "$html_file.gz" "$xhtml_file.gz"
fi
if [ -f "$html_file.br" ]; then
cp -p "$html_file.br" "$xhtml_file.br"
fi