feat: US-002 - Guard against data loss in archive.sh
This commit is contained in:
@@ -75,6 +75,12 @@ archive_run() {
|
|||||||
[ -d "$LOOP_DIR/contracts" ] && cp -r "$LOOP_DIR/contracts" "$archive_dir/"
|
[ -d "$LOOP_DIR/contracts" ] && cp -r "$LOOP_DIR/contracts" "$archive_dir/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Verify the archive received content before deleting originals
|
||||||
|
if ! find "$archive_dir" -maxdepth 1 -type f | read -r; then
|
||||||
|
log "WARNING: Archive directory $archive_dir is empty after copy — skipping deletion of originals to prevent data loss"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
# Clean up old run's artifacts (progress.md, contracts — NOT prd.json which belongs to new feature)
|
# Clean up old run's artifacts (progress.md, contracts — NOT prd.json which belongs to new feature)
|
||||||
rm -f "$LOOP_DIR/progress.md"
|
rm -f "$LOOP_DIR/progress.md"
|
||||||
rm -rf "$LOOP_DIR/contracts"
|
rm -rf "$LOOP_DIR/contracts"
|
||||||
|
|||||||
Reference in New Issue
Block a user