aboutsummaryrefslogtreecommitdiffstats
path: root/build/image-optimization.sh
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-04-21 13:32:11 +0200
committerJoas Schilling <coding@schilljs.com>2020-04-21 13:32:11 +0200
commitf354a4f17f7b58591f7373cf649aaad84c28cc60 (patch)
treee86947e984c3635478db6c9037cf346224c00576 /build/image-optimization.sh
parent4651ff5a50d1fb0e88adbbf2adaa734bca3b4c07 (diff)
downloadnextcloud-server-f354a4f17f7b58591f7373cf649aaad84c28cc60.tar.gz
nextcloud-server-f354a4f17f7b58591f7373cf649aaad84c28cc60.zip
FIx glob usage to avoid problems with directories that contain spaces
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'build/image-optimization.sh')
-rwxr-xr-xbuild/image-optimization.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/build/image-optimization.sh b/build/image-optimization.sh
index 65a5bb46362..bf825c96cc6 100755
--- a/build/image-optimization.sh
+++ b/build/image-optimization.sh
@@ -8,7 +8,7 @@ function recursive_optimize_images() {
jpegoptim --strip-all *.jpg;
# Optimize all SVGs
- for svg in `ls *.svg`;
+ for svg in *.svg;
do
mv $svg $svg.opttmp;
scour --create-groups \
@@ -26,10 +26,12 @@ function recursive_optimize_images() {
rm *.opttmp
# Check all subfolders
- for dir in `ls -d */`;
+ for dir in */
do
- recursive_optimize_images $dir;
- cd ..;
+ if [[ -d "$DIR" ]]; then
+ recursive_optimize_images "$dir"
+ cd ..
+ fi
done;
}