Skip to content

Commit f83a8d7

Browse files
wip (#589) (#590)
1 parent 6c5fd22 commit f83a8d7

File tree

1 file changed

+8
-20
lines changed

1 file changed

+8
-20
lines changed

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

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -66,36 +66,24 @@ echo ""
6666
echo "SVN Status Summary (what would be committed):"
6767
echo "=========================================="
6868
SVN_STATUS=$(svn status 2>/dev/null || echo "")
69-
TOTAL_CHANGES=0
7069
if [ -n "$SVN_STATUS" ]; then
7170
echo "$SVN_STATUS"
7271
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
85-
echo ""
86-
TOTAL_CHANGES=$((ADDED_COUNT + MODIFIED_COUNT))
87-
echo "Total files that would be committed: $TOTAL_CHANGES files"
72+
TOTAL_FILES=$(echo "$SVN_STATUS" | grep -v '^.[ \t]*\\..*' | wc -l)
73+
TOTAL_FILES=$(echo "$TOTAL_FILES" | tr -d '[:space:]')
74+
TOTAL_FILES=${TOTAL_FILES:-0}
75+
echo "Total files to upload: $TOTAL_FILES"
8876
else
89-
echo "(No changes detected - files are up to date)"
77+
echo "(No files detected)"
9078
fi
9179
echo "=========================================="
9280
echo ""
9381

94-
if [ "$TOTAL_CHANGES" -gt 0 ]; then
95-
echo "DRY RUN: Would commit $TOTAL_CHANGES files to version folder $VERSION_DIR"
82+
if [ -n "$SVN_STATUS" ]; then
83+
echo "DRY RUN: Would commit all files to version folder $VERSION_DIR"
9684
echo "Commit message: Upload v${THEME_VERSION}"
9785
else
98-
echo "DRY RUN: No changes to commit (files are up to date)"
86+
echo "DRY RUN: No files to commit"
9987
fi
10088
echo "No actual commit performed (dry-run mode)"
10189

0 commit comments

Comments
 (0)