aboutsummaryrefslogtreecommitdiffstats
path: root/build/image-optimization.sh
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-04-21 13:33:11 +0200
committerJoas Schilling <coding@schilljs.com>2020-04-21 13:33:11 +0200
commite49b6c576d524a2930c4b82e57e5c1e6da35bc6a (patch)
treed56ce6007c7353c15ec6be0a6cbccd59e3196ef3 /build/image-optimization.sh
parentf354a4f17f7b58591f7373cf649aaad84c28cc60 (diff)
downloadnextcloud-server-e49b6c576d524a2930c4b82e57e5c1e6da35bc6a.tar.gz
nextcloud-server-e49b6c576d524a2930c4b82e57e5c1e6da35bc6a.zip
Don't error when the directory is broken
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'build/image-optimization.sh')
-rwxr-xr-xbuild/image-optimization.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/build/image-optimization.sh b/build/image-optimization.sh
index bf825c96cc6..148f0c9695a 100755
--- a/build/image-optimization.sh
+++ b/build/image-optimization.sh
@@ -1,14 +1,14 @@
#!/usr/bin/env bash
function recursive_optimize_images() {
- cd "$1":
+ cd "$1" || return
# Optimize all JPGs and PNGs
- optipng -o6 -strip all *.png;
- jpegoptim --strip-all *.jpg;
+ optipng -o6 -strip all *.png
+ jpegoptim --strip-all *.jpg
# Optimize all SVGs
- for svg in *.svg;
+ for svg in *.svg
do
mv $svg $svg.opttmp;
scour --create-groups \
@@ -19,8 +19,8 @@ function recursive_optimize_images() {
--strip-xml-prolog \
--no-line-breaks \
-i $svg.opttmp \
- -o $svg;
- done;
+ -o $svg
+ done
# Remove temporary SVGs
rm *.opttmp
@@ -32,7 +32,7 @@ function recursive_optimize_images() {
recursive_optimize_images "$dir"
cd ..
fi
- done;
+ done
}
recursive_optimize_images ../