Skip to content

Commit 709aff2

Browse files
author
Naran Arethiya
committed
WPVTWO-4512: add deleted dir in in deleted_file.txt
1 parent fecbae8 commit 709aff2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,17 @@ runs:
165165
rsync -av --dry-run --delete --ignore-existing $EXCLUDE_ARGS \
166166
-e "ssh $SSH_AUTH" \
167167
"$CHECKOUT_DIR/" "$SSH_USER@$SSH_HOST:/$WP_DEST_DIR/" \
168-
| grep '^deleting ' 2>/dev/null | awk '{print $2}' | grep -v '/$' > "$DEL_FILE_LIST" || true
168+
| grep '^deleting ' 2>/dev/null | awk '{print $2}' > "$DEL_FILE_LIST" || true
169169
170170
if [[ $? -ne 0 ]]; then
171171
echo "Error: Failed to prepare the list of files to delete."
172172
exit 1
173173
fi
174+
175+
# Remove files that are under deleted directories
176+
for dir in $(cat "$DEL_FILE_LIST" | grep '/$'); do
177+
sed -i "\#^${dir}[^/]\+#d" "$DEL_FILE_LIST"
178+
done
174179
175180
echo $(basename "$DEL_FILE_LIST") >> "$SYNC_FILES"
176181
echo "Files to be DELETED:"

0 commit comments

Comments
 (0)