Skip to content

Commit 50608f8

Browse files
author
Dani Llewellyn
committed
Update deploy.sh to fix shell glob in svn propsets
The glob of `*.png`, `*.jpg`, `*.gif`, and `*.svg` in the `svn propset svn:mime-type` commands fail due to being quoted. SVN does not support expanding the globs itself, so we need to rely on the shell expanding them. Shell globs are only expanded when the `*` is unquoted, but currently the whole path including the glob is within quotes meaning that we're trying to pass the literal string `*.png` etc with the `*` unexpanded. * Unquote the globs in `svn propset svn:mime-type` commands to allow expansion by the shell
1 parent b2eebb9 commit 50608f8

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

deploy.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,16 @@ svn cp "trunk" "tags/$VERSION"
135135
# Fix screenshots getting force downloaded when clicking them
136136
# https://developer.wordpress.org/plugins/wordpress-org/plugin-assets/
137137
if test -d "$SVN_DIR/assets" && test -n "$(find "$SVN_DIR/assets" -maxdepth 1 -name "*.png" -print -quit)"; then
138-
svn propset svn:mime-type "image/png" "$SVN_DIR/assets/*.png" || true
138+
svn propset svn:mime-type "image/png" "$SVN_DIR/assets/"*.png || true
139139
fi
140140
if test -d "$SVN_DIR/assets" && test -n "$(find "$SVN_DIR/assets" -maxdepth 1 -name "*.jpg" -print -quit)"; then
141-
svn propset svn:mime-type "image/jpeg" "$SVN_DIR/assets/*.jpg" || true
141+
svn propset svn:mime-type "image/jpeg" "$SVN_DIR/assets/"*.jpg || true
142142
fi
143143
if test -d "$SVN_DIR/assets" && test -n "$(find "$SVN_DIR/assets" -maxdepth 1 -name "*.gif" -print -quit)"; then
144-
svn propset svn:mime-type "image/gif" "$SVN_DIR/assets/*.gif" || true
144+
svn propset svn:mime-type "image/gif" "$SVN_DIR/assets/"*.gif || true
145145
fi
146146
if test -d "$SVN_DIR/assets" && test -n "$(find "$SVN_DIR/assets" -maxdepth 1 -name "*.svg" -print -quit)"; then
147-
svn propset svn:mime-type "image/svg+xml" "$SVN_DIR/assets/*.svg" || true
147+
svn propset svn:mime-type "image/svg+xml" "$SVN_DIR/assets/"*.svg || true
148148
fi
149149

150150
#Resolves => SVN commit failed: Directory out of date

0 commit comments

Comments
 (0)