aboutsummaryrefslogtreecommitdiff
path: root/sswg.sh
diff options
context:
space:
mode:
authorkeni7385 <andrea@andreacorsini.xyz>2022-07-25 23:18:03 +0200
committerkeni7385 <andrea@andreacorsini.xyz>2022-07-25 23:18:03 +0200
commit082cbf264a2f357786cc5030e5453bd9d0bb638c (patch)
treed37581992ffd4454b483a230c23723324439f5d4 /sswg.sh
parent90065a4b6655e4b16fda0e0fe1a93c0b30ad1d25 (diff)
Mainly sswg bugfix: filenames with spacesHEADmaster
Diffstat (limited to 'sswg.sh')
-rwxr-xr-xsswg.sh7
1 files changed, 3 insertions, 4 deletions
diff --git a/sswg.sh b/sswg.sh
index 6e7b42d..d62233d 100755
--- a/sswg.sh
+++ b/sswg.sh
@@ -14,11 +14,10 @@ mkdir "$SSWG_OUTPUT_DIR"
cp -r "$SSWG_ASSETS_DIR"/* "$SSWG_OUTPUT_DIR"/.
# Generate HTML pages
-for page in $(find "$SSWG_PAGES_DIR" -iname '*.html' -o \
- -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png');
+find "$SSWG_PAGES_DIR" -iname '*.html' -o -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' | while read -r page;
do
filename="$SSWG_OUTPUT_DIR/${page##$SSWG_PAGES_DIR/}"
- mkdir -p "`dirname $filename`"
+ mkdir -p "$(dirname "$filename")"
if [ "${filename##*.}" = "html" ]; then
# prepose header
@@ -45,6 +44,6 @@ do
# useful e.g. with <pre> tags
sed -i'' "s/^[ \t]*|//g" "$filename" # remove
else
- cp $page $filename
+ cp "$page" "$filename"
fi;
done;