Skip to content

Commit d515ea0

Browse files
authored
Merge pull request #82 from Lewiscowles1986/patch-2
Fix: Repo with no images gets SVN error
2 parents 93c80ab + 2107156 commit d515ea0

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

deploy.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,18 @@ svn cp "trunk" "tags/$VERSION"
115115

116116
# Fix screenshots getting force downloaded when clicking them
117117
# https://developer.wordpress.org/plugins/wordpress-org/plugin-assets/
118-
svn propset svn:mime-type image/png assets/*.png || true
119-
svn propset svn:mime-type image/jpeg assets/*.jpg || true
120-
svn propset svn:mime-type image/gif assets/*.gif || true
121-
svn propset svn:mime-type image/svg+xml assets/*.svg || true
118+
if test -d "$SVN_DIR/assets" && test -n "$(find "$SVN_DIR/assets" -maxdepth 1 -name "*.png" -print -quit)"; then
119+
svn propset svn:mime-type "image/png" "$SVN_DIR/assets/*.png" || true
120+
fi
121+
if test -d "$SVN_DIR/assets" && test -n "$(find "$SVN_DIR/assets" -maxdepth 1 -name "*.jpg" -print -quit)"; then
122+
svn propset svn:mime-type "image/jpeg" "$SVN_DIR/assets/*.jpg" || true
123+
fi
124+
if test -d "$SVN_DIR/assets" && test -n "$(find "$SVN_DIR/assets" -maxdepth 1 -name "*.gif" -print -quit)"; then
125+
svn propset svn:mime-type "image/gif" "$SVN_DIR/assets/*.gif" || true
126+
fi
127+
if test -d "$SVN_DIR/assets" && test -n "$(find "$SVN_DIR/assets" -maxdepth 1 -name "*.svg" -print -quit)"; then
128+
svn propset svn:mime-type "image/svg+xml" "$SVN_DIR/assets/*.svg" || true
129+
fi
122130

123131
svn status
124132

0 commit comments

Comments
 (0)