Skip to content

Commit

Permalink
Adjust propset for images
Browse files Browse the repository at this point in the history
This is a port of 10up/action-wordpress-plugin-deploy#82 to also bring support for gif and svg types.
  • Loading branch information
ocean90 authored Mar 23, 2022
1 parent 380f651 commit 58a0ccf
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,18 @@ rsync -rc "$GITHUB_WORKSPACE/$ASSETS_DIR/" assets/ --delete --delete-excluded

# Fix screenshots getting force downloaded when clicking them
# https://developer.wordpress.org/plugins/wordpress-org/plugin-assets/
svn propset svn:mime-type image/png assets/*.png || true
svn propset svn:mime-type image/jpeg assets/*.jpg || true
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
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
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
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
fi

echo "➤ Preparing files..."

Expand Down

0 comments on commit 58a0ccf

Please sign in to comment.