Skip to content

Commit 2d05534

Browse files
Add plugin version check
1 parent 15d7f90 commit 2d05534

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

deploy.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,19 @@ fi
5454
SVN_URL="https://plugins.svn.wordpress.org/${SLUG}/"
5555
SVN_DIR="${HOME}/svn-${SLUG}"
5656

57-
# Checkout just trunk and assets for efficiency
58-
# Tagging will be handled on the SVN level
57+
# Checkout SVN repository.
5958
echo "➤ Checking out .org repository..."
6059
svn checkout --depth immediates "$SVN_URL" "$SVN_DIR"
6160
cd "$SVN_DIR"
6261
svn update --set-depth infinity assets
6362
svn update --set-depth infinity trunk
63+
svn update --set-depth infinity tags
6464

65+
# Bail early if the plugin version is already published.
66+
if [[ -d "tags/$VERSION" ]]; then
67+
echo "ℹ︎ Version $VERSION of plugin $SLUG was already published";
68+
exit
69+
fi
6570

6671
if [[ "$BUILD_DIR" = false ]]; then
6772
echo "➤ Copying files..."

0 commit comments

Comments
 (0)