File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -165,12 +165,17 @@ runs:
165
165
rsync -av --dry-run --delete --ignore-existing $EXCLUDE_ARGS \
166
166
-e "ssh $SSH_AUTH" \
167
167
"$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
169
169
170
170
if [[ $? -ne 0 ]]; then
171
171
echo "Error: Failed to prepare the list of files to delete."
172
172
exit 1
173
173
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
174
179
175
180
echo $(basename "$DEL_FILE_LIST") >> "$SYNC_FILES"
176
181
echo "Files to be DELETED:"
You can’t perform that action at this time.
0 commit comments