Skip to content

Commit 38e8571

Browse files
authored
Merge pull request #124 from mukeshpanchal27/fix/123-re-publishing-same-version
Fix deploy script to not attempt re-publishing the same version of a plugin
2 parents 16af012 + 4cc6234 commit 38e8571

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
@@ -58,14 +58,19 @@ fi
5858
SVN_URL="https://plugins.svn.wordpress.org/${SLUG}/"
5959
SVN_DIR="${HOME}/svn-${SLUG}"
6060

61-
# Checkout just trunk and assets for efficiency
62-
# Tagging will be handled on the SVN level
61+
# Checkout SVN repository.
6362
echo "➤ Checking out .org repository..."
6463
svn checkout --depth immediates "$SVN_URL" "$SVN_DIR"
6564
cd "$SVN_DIR"
6665
svn update --set-depth infinity assets
6766
svn update --set-depth infinity trunk
67+
svn update --set-depth immediates tags
6868

69+
# Bail early if the plugin version is already published.
70+
if [[ -d "tags/$VERSION" ]]; then
71+
echo "ℹ︎ Version $VERSION of plugin $SLUG was already published";
72+
exit
73+
fi
6974

7075
if [[ "$BUILD_DIR" = false ]]; then
7176
echo "➤ Copying files..."

0 commit comments

Comments
 (0)