Skip to content

Commit 6185743

Browse files
authored
WIP on internal/TMZ-803-update-dry-run-reporting (#591)
1 parent 32b9bc9 commit 6185743

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,35 +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 "")
6971
if [ -n "$SVN_STATUS" ]; then
7072
echo "$SVN_STATUS"
7173
echo ""
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}
74+
TOTAL_FILES=$(echo "$SVN_STATUS" | wc -l | tr -d '[:space:]')
7575
echo "Total files to upload: $TOTAL_FILES"
76-
else
77-
echo "(No files detected)"
78-
fi
79-
echo "=========================================="
80-
echo ""
81-
82-
if [ -n "$SVN_STATUS" ]; then
76+
echo ""
8377
echo "DRY RUN: Would commit all files to version folder $VERSION_DIR"
8478
echo "Commit message: Upload v${THEME_VERSION}"
8579
else
86-
echo "DRY RUN: No files to commit"
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}"
8785
fi
86+
echo "=========================================="
87+
echo ""
8888
echo "No actual commit performed (dry-run mode)"
8989

9090
echo "Remove the SVN folder from the workspace"

0 commit comments

Comments
 (0)