From 320ba5118adc5d4c4a1ee7398128870ec59e849a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Mon, 24 Aug 2026 19:24:12 -0400 Subject: [PATCH] Update: strict-mode migrations, per-file completion markers Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01QKxGW1raAWaqeU8WdHsMsp --- bin/omarchy-cn-update | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/bin/omarchy-cn-update b/bin/omarchy-cn-update index 4889a2b1..a5bff24b 100755 --- a/bin/omarchy-cn-update +++ b/bin/omarchy-cn-update @@ -5,7 +5,7 @@ set -euo pipefail MANIFEST="$HOME/.local/state/omarchycn/overlay-manifest" -MIGRATION_STATE="$HOME/.local/state/omarchycn/last-migration" +MIGRATION_DONE_DIR="$HOME/.local/state/omarchycn/migrations-done" if [[ ! -f $MANIFEST ]]; then echo "Not an overlay install (no $MANIFEST)." >&2 @@ -26,20 +26,16 @@ echo "Source: $old -> $new" "$src/bin/omarchy-cn-install-overlay" -# Run migrations newer than the last recorded one, in filename order -last="" -if [[ -f $MIGRATION_STATE ]]; then - last=$(<"$MIGRATION_STATE") -fi - +# Run each not-yet-completed migration in filename order, one marker per file if [[ -d $src/cn/migrations ]]; then + mkdir -p "$MIGRATION_DONE_DIR" for m in "$src"/cn/migrations/*.sh; do [[ -f $m ]] || continue name="${m##*/}" - if [[ $name > $last ]]; then + if [[ ! -f $MIGRATION_DONE_DIR/$name ]]; then echo "Migration: $name" - bash "$m" - echo "$name" > "$MIGRATION_STATE" + bash -euo pipefail "$m" + touch "$MIGRATION_DONE_DIR/$name" fi done fi