From 709aff22dcbcc99ac2229d7c6e22ad51ef6f1b6b Mon Sep 17 00:00:00 2001 From: Naran Arethiya Date: Fri, 20 Jun 2025 16:20:47 +0530 Subject: [PATCH] WPVTWO-4512: add deleted dir in in deleted_file.txt --- action.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 4def0c1..dd2d4fa 100644 --- a/action.yml +++ b/action.yml @@ -165,12 +165,17 @@ runs: rsync -av --dry-run --delete --ignore-existing $EXCLUDE_ARGS \ -e "ssh $SSH_AUTH" \ "$CHECKOUT_DIR/" "$SSH_USER@$SSH_HOST:/$WP_DEST_DIR/" \ - | grep '^deleting ' 2>/dev/null | awk '{print $2}' | grep -v '/$' > "$DEL_FILE_LIST" || true + | grep '^deleting ' 2>/dev/null | awk '{print $2}' > "$DEL_FILE_LIST" || true if [[ $? -ne 0 ]]; then echo "Error: Failed to prepare the list of files to delete." exit 1 fi + + # Remove files that are under deleted directories + for dir in $(cat "$DEL_FILE_LIST" | grep '/$'); do + sed -i "\#^${dir}[^/]\+#d" "$DEL_FILE_LIST" + done echo $(basename "$DEL_FILE_LIST") >> "$SYNC_FILES" echo "Files to be DELETED:"