From 50608f8f2859c1b079a1c7d3acf60845ff45ce9f Mon Sep 17 00:00:00 2001 From: Dani Llewellyn Date: Tue, 28 Jun 2022 22:21:36 +0100 Subject: [PATCH] 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 --- deploy.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy.sh b/deploy.sh index ca7cfd7..4858875 100755 --- a/deploy.sh +++ b/deploy.sh @@ -135,16 +135,16 @@ svn cp "trunk" "tags/$VERSION" # Fix screenshots getting force downloaded when clicking them # https://developer.wordpress.org/plugins/wordpress-org/plugin-assets/ if test -d "$SVN_DIR/assets" && test -n "$(find "$SVN_DIR/assets" -maxdepth 1 -name "*.png" -print -quit)"; then - svn propset svn:mime-type "image/png" "$SVN_DIR/assets/*.png" || true + svn propset svn:mime-type "image/png" "$SVN_DIR/assets/"*.png || true fi if test -d "$SVN_DIR/assets" && test -n "$(find "$SVN_DIR/assets" -maxdepth 1 -name "*.jpg" -print -quit)"; then - svn propset svn:mime-type "image/jpeg" "$SVN_DIR/assets/*.jpg" || true + svn propset svn:mime-type "image/jpeg" "$SVN_DIR/assets/"*.jpg || true fi if test -d "$SVN_DIR/assets" && test -n "$(find "$SVN_DIR/assets" -maxdepth 1 -name "*.gif" -print -quit)"; then - svn propset svn:mime-type "image/gif" "$SVN_DIR/assets/*.gif" || true + svn propset svn:mime-type "image/gif" "$SVN_DIR/assets/"*.gif || true fi if test -d "$SVN_DIR/assets" && test -n "$(find "$SVN_DIR/assets" -maxdepth 1 -name "*.svg" -print -quit)"; then - svn propset svn:mime-type "image/svg+xml" "$SVN_DIR/assets/*.svg" || true + svn propset svn:mime-type "image/svg+xml" "$SVN_DIR/assets/"*.svg || true fi #Resolves => SVN commit failed: Directory out of date