Quote variables in build_theme.sh to prevent word splitting

parent 53afd499
...@@ -4,8 +4,8 @@ create_folders () { ...@@ -4,8 +4,8 @@ create_folders () {
FOLDERS=(gtk-2.0 gtk-3.0 gtk-3.18 gtk-3.20) FOLDERS=(gtk-2.0 gtk-3.0 gtk-3.18 gtk-3.20)
for j in "${FOLDERS[@]}" for j in "${FOLDERS[@]}"
do do
if ! [ -d $1/$j ] if ! [ -d "$1/$j" ]
then mkdir -p $1/$j; then mkdir -p "$1/$j";
fi fi
done done
} }
...@@ -20,17 +20,17 @@ build_sass() { ...@@ -20,17 +20,17 @@ build_sass() {
} }
render_theme () { render_theme () {
python3 render_assets.py $1 python3 render_assets.py "$1"
create_folders $2 create_folders "$2"
build_sass gtk316/gtk.scss $2/gtk-3.0/gtk.css build_sass gtk316/gtk.scss "$2/gtk-3.0/gtk.css"
build_sass gtk318/gtk.scss $2/gtk-3.18/gtk.css build_sass gtk318/gtk.scss "$2/gtk-3.18/gtk.css"
build_sass gtk320/gtk.scss $2/gtk-3.20/gtk.css build_sass gtk320/gtk.scss "$2/gtk-3.20/gtk.css"
mv assets $2/ mv assets "$2/"
cp -R gtk2/* $2/gtk-2.0/ cp -R gtk2/* "$2/gtk-2.0/"
if [ -d $HOME/.local/share/themes/$2 ] if [ -d "$HOME/.local/share/themes/$2" ]
then rm -rf $HOME/.local/share/themes/$2; then rm -rf "$HOME/.local/share/themes/$2";
fi fi
mv -f $2 $HOME/.local/share/themes/ mv -f "$2" "$HOME/.local/share/themes/"
} }
if [ -z "$1" ] if [ -z "$1" ]
...@@ -45,7 +45,7 @@ then ...@@ -45,7 +45,7 @@ then
else else
if [ -f "schemes/$1.colors" ] if [ -f "schemes/$1.colors" ]
then then
render_theme schemes/$1.colors $1 render_theme "schemes/$1.colors" "$1"
else else
echo "colorscheme $1 not found" echo "colorscheme $1 not found"
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment