summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonard K├Ânig <leonard.r.koenig@googlemail.com>2017-01-20 22:44:33 (GMT)
committerAlbert Astals Cid <aacid@kde.org>2017-01-20 22:44:33 (GMT)
commita18d9d32455a82be1dd5001dcffb78583fa27906 (patch)
treed6a82f02230cf32904b8fa54016074116a28c0b5
parenta655f87bd4ccfd72d8a1e5e109a8321747f396bf (diff)
Fix handling of paths with whitespace in bash
REVIEW: 129013
-rwxr-xr-xthemeexplorer/package/contents/code/openInEditor.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/themeexplorer/package/contents/code/openInEditor.sh b/themeexplorer/package/contents/code/openInEditor.sh
index b80e004..e45e0e5 100755
--- a/themeexplorer/package/contents/code/openInEditor.sh
+++ b/themeexplorer/package/contents/code/openInEditor.sh
@@ -5,20 +5,20 @@ if [ $# -ne 1 ];
exit 1
fi
-if [ ! -f $1 ]; then
+if [ ! -f "$1" ]; then
echo "you must specify a valid svg"
exit 1
fi
-inkscape $1
+inkscape "$1"
-file=${1%.*}
-mv $1 $file.svg.gz
-gunzip $file.svg.gz
+file="${1%.*}"
+mv "$1" "$file.svg.gz"
+gunzip "$file.svg.gz"
-echo Processing $file
+echo Processing "$file"
-/usr/bin/perl -p -i -e "s/color:#[^;]*;fill:currentColor/fill:currentColor/g" $file.svg
+/usr/bin/perl -p -i -e "s/color:#[^;]*;fill:currentColor/fill:currentColor/g" "$file.svg"
-gzip $file.svg
-mv $file.svg.gz $file.svgz
+gzip "$file.svg"
+mv "$file.svg.gz" "$file.svgz"