1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-23 21:02:09 +00:00
seirdy.one/scripts/copy-file-to-xhtml.sh

18 lines
418 B
Bash
Raw Normal View History

#!/bin/sh
# Take a single polygot (X)HTML file and make a .xhtml copy of it. Do
# the same for static-compressed versions.
2023-11-25 21:40:52 +00:00
# no pipefail here since there are no pipes.
set -e -u
html_file="$1"
xhtml_file="${html_file%*.html}.xhtml"
cp -p "$html_file" "$xhtml_file"
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