Badal commited on
Commit ·
9dfa504
1
Parent(s): a8abfdf
Fix: Continue if restore fails (empty bucket)
Browse files- 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 (
|
| 23 |
# ============================================
|
| 24 |
echo '=== [STEP 1] RESTORING DATA FROM BUCKET ==='
|
| 25 |
-
hf sync "$BUCKET" "$SOURCE"
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
| 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
|