@@ -56,35 +56,35 @@ echo "Copy files from build directory"
5656rsync -ah --progress " $THEME_PATH /hello-elementor/" * . || rsync -ah --progress " $THEME_PATH /hello-elementor/." . || true
5757
5858echo " 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 " "
6162echo " svn add new files"
6263echo " 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
6568echo " "
6669echo " SVN Status Summary (what would be committed):"
6770echo " =========================================="
68- SVN_STATUS=$( svn status 2> /dev/null || echo " " )
6971if [ -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} "
8579else
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} "
8785fi
86+ echo " =========================================="
87+ echo " "
8888echo " No actual commit performed (dry-run mode)"
8989
9090echo " Remove the SVN folder from the workspace"
0 commit comments