Skip to content

Commit e3db702

Browse files
committed
Update cleanup command
1 parent e8b7155 commit e3db702

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ preview:
5858
@echo "\n\n**** Preview complete.\n\n"
5959
@echo "Open the preview site at: $(PREVIEW_SITE_URL)\n\n"
6060
@echo "\n**** Cleaning up old releases (keep latest 3, skip 'current')...\n"
61-
$(REMOTE_CMD) bash -c "'cd $(RELEASES_DIR) && ls -1dt */ | grep -v \"^current/?$$\" | grep -v \"^$(TIMESTAMP)/$$\" | xargs -r echo rm -rf'" | tee /dev/stdout
61+
$(REMOTE_CMD) 'bash -c "cd $(RELEASES_DIR) && \
62+
for dir in $(ls -1dt */ | sed \"s:/*$$::\" | grep -v ^current$$ | grep -v ^$(TIMESTAMP)$$ | tail -n +2); do \
63+
echo rm -rf \"$$dir\"; \
64+
done"' | tee /dev/stdout
6265

6366

6467
ifeq ($(FORCE_DEPLOY), true)

0 commit comments

Comments
 (0)