Badal commited on
Commit
9dfa504
·
1 Parent(s): a8abfdf

Fix: Continue if restore fails (empty bucket)

Browse files
Files changed (1) hide show
  1. entrypoint.sh +6 -4
entrypoint.sh CHANGED
@@ -19,12 +19,14 @@ OP_PATH=$(find / -name opencode -type f -printf '%h' -quit 2>/dev/null)
19
  export PATH="$OP_PATH:$PATH"
20
 
21
  # ============================================
22
- # STEP 1: RESTORE (MUST SUCCEED)
23
  # ============================================
24
  echo '=== [STEP 1] RESTORING DATA FROM BUCKET ==='
25
- hf sync "$BUCKET" "$SOURCE" \
26
- || { echo 'CRITICAL: Restore failed! Exiting to prevent bucket wipe!'; exit 1; }
27
- echo '=== [STEP 1] RESTORE COMPLETE ==='
 
 
28
 
29
  # ============================================
30
  # STEP 2: START OPENCODE
 
19
  export PATH="$OP_PATH:$PATH"
20
 
21
  # ============================================
22
+ # STEP 1: RESTORE (Try, but continue if bucket empty)
23
  # ============================================
24
  echo '=== [STEP 1] RESTORING DATA FROM BUCKET ==='
25
+ if hf sync "$BUCKET" "$SOURCE" --delete 2>/dev/null; then
26
+ echo '=== [STEP 1] RESTORE COMPLETE ==='
27
+ else
28
+ echo '=== [STEP 1] Restore skipped (bucket empty or failed - continuing anyway) ==='
29
+ fi
30
 
31
  # ============================================
32
  # STEP 2: START OPENCODE