Skip to content

Commit 6c21a9a

Browse files
authored
Merge branch 'main' into internal/test-new-deployment
2 parents 3896631 + 6185743 commit 6c21a9a

File tree

1 file changed

+14
-26
lines changed

1 file changed

+14
-26
lines changed

.github/scripts/publish-theme-to-wordpress-org-dry-run.sh

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -56,47 +56,35 @@ echo "Copy files from build directory"
5656
rsync -ah --progress "$THEME_PATH/hello-elementor/"* . || rsync -ah --progress "$THEME_PATH/hello-elementor/." . || true
5757

5858
echo "Preparing files for SVN"
59-
svn status 2>/dev/null || echo ""
59+
SVN_STATUS=$(svn status 2>/dev/null | grep -v '^\?[ \t]*\.$' || echo "")
6060

61+
echo ""
6162
echo "svn add new files"
6263
echo "DRY RUN: Would add new files"
63-
svn status 2>/dev/null | grep -v '^.[ \t]*\\..*' | { grep '^?' || true; } | awk '{print $2}' | sed 's|^| Would add: |' || true
64+
if [ -n "$SVN_STATUS" ]; then
65+
echo "$SVN_STATUS" | grep '^?' | awk '{print " Would add: " $2}' || true
66+
fi
6467

6568
echo ""
6669
echo "SVN Status Summary (what would be committed):"
6770
echo "=========================================="
68-
SVN_STATUS=$(svn status 2>/dev/null || echo "")
69-
TOTAL_CHANGES=0
7071
if [ -n "$SVN_STATUS" ]; then
7172
echo "$SVN_STATUS"
7273
echo ""
73-
echo "Summary:"
74-
ADDED_COUNT=$(echo "$SVN_STATUS" | grep -c "^A" || echo "0")
75-
MODIFIED_COUNT=$(echo "$SVN_STATUS" | grep -c "^M" || echo "0")
76-
UNTRACKED_COUNT=$(echo "$SVN_STATUS" | grep -c "^?" || echo "0")
77-
78-
echo "Added (A): $ADDED_COUNT files"
79-
if [ "$MODIFIED_COUNT" -gt 0 ]; then
80-
echo "Modified (M): $MODIFIED_COUNT files"
81-
fi
82-
if [ "$UNTRACKED_COUNT" -gt 0 ]; then
83-
echo "Untracked (?): $UNTRACKED_COUNT files (would be added)"
84-
fi
74+
TOTAL_FILES=$(echo "$SVN_STATUS" | wc -l | tr -d '[:space:]')
75+
echo "Total files to upload: $TOTAL_FILES"
8576
echo ""
86-
TOTAL_CHANGES=$((ADDED_COUNT + MODIFIED_COUNT))
87-
echo "Total files that would be committed: $TOTAL_CHANGES files"
77+
echo "DRY RUN: Would commit all files to version folder $VERSION_DIR"
78+
echo "Commit message: Upload v${THEME_VERSION}"
8879
else
89-
echo "(No changes detected - files are up to date)"
80+
TOTAL_FILES=$(find . -type f ! -name '.svn' ! -path '*/.svn/*' | wc -l | tr -d '[:space:]')
81+
echo "Total files to upload: $TOTAL_FILES"
82+
echo ""
83+
echo "DRY RUN: Would commit all files to version folder $VERSION_DIR"
84+
echo "Commit message: Upload v${THEME_VERSION}"
9085
fi
9186
echo "=========================================="
9287
echo ""
93-
94-
if [ "$TOTAL_CHANGES" -gt 0 ]; then
95-
echo "DRY RUN: Would commit $TOTAL_CHANGES files to version folder $VERSION_DIR"
96-
echo "Commit message: Upload v${THEME_VERSION}"
97-
else
98-
echo "DRY RUN: No changes to commit (files are up to date)"
99-
fi
10088
echo "No actual commit performed (dry-run mode)"
10189

10290
echo "Remove the SVN folder from the workspace"

0 commit comments

Comments
 (0)