summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2023-04-17 10:25:24 +0200
committerGitHub <noreply@github.com>2023-04-17 10:25:24 +0200
commitb21c5c86e5908274e67fc31178e0dff24eed1136 (patch)
tree39774b403da57cafdb6a97c633d16224c9c9bf04 /build
parenta5348bc400a6d6aa7fe3e1b060fcc41e98695174 (diff)
parent64843c24ef5cf1c83b2395b242eb5692fc3db36e (diff)
downloadnextcloud-server-b21c5c86e5908274e67fc31178e0dff24eed1136.tar.gz
nextcloud-server-b21c5c86e5908274e67fc31178e0dff24eed1136.zip
Merge pull request #37735 from nextcloud/techdebt/ref-37476/ignore-excluded-dirs-on-image-optimization
chore(assets): Ignore git-ignored directories on image optimization
Diffstat (limited to 'build')
-rwxr-xr-xbuild/image-optimization.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/build/image-optimization.sh b/build/image-optimization.sh
index e559d8552f6..1079716e626 100755
--- a/build/image-optimization.sh
+++ b/build/image-optimization.sh
@@ -30,8 +30,19 @@ function recursive_optimize_images() {
DIR_NAME=${PWD##*/}
if [[ "$DIR_NAME" == "node_modules" ]]; then
+ echo "Ignoring node_modules for image optimization"
return
elif [[ "$DIR_NAME" == "tests" ]]; then
+ echo "Ignoring tests for image optimization"
+ return
+ elif [[ "$DIR_NAME" == "3rdparty" ]]; then
+ echo "Ignoring 3rdparty for image optimization"
+ return
+ elif [[ "$DIR_NAME" == "vendor" ]]; then
+ echo "Ignoring vendor for image optimization"
+ return
+ elif [[ "$DIR_NAME" == "vendor-bin" ]]; then
+ echo "Ignoring vendor-bin for image optimization"
return
fi
@@ -75,6 +86,11 @@ function recursive_optimize_images() {
[[ -e "$dir" ]] || break
if [[ -d "$dir" ]]; then
+ if git check-ignore $dir -q ; then
+ echo "$dir is not shipped. Ignoring image optimization"
+ continue
+ fi
+
recursive_optimize_images "$dir"
cd ..
fi