From 082cbf264a2f357786cc5030e5453bd9d0bb638c Mon Sep 17 00:00:00 2001 From: keni7385 Date: Mon, 25 Jul 2022 23:18:03 +0200 Subject: Mainly sswg bugfix: filenames with spaces --- sswg.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sswg.sh') 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
 tags
         sed -i'' "s/^[ \t]*|//g" "$filename"  # remove
     else
-        cp $page $filename
+        cp "$page" "$filename"
     fi;
 done;
-- 
cgit v1.2.3-70-g09d2