Move the cn migration call into omarchy-migrate and guard downgrades onto pre-migrate trees

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kb7vDj6PHwymeDeSUUk1eX
This commit is contained in:
2026-08-28 13:46:25 -04:00
co-authored by Claude Fable 5
parent 81c253b86e
commit 39026fd41e
5 changed files with 14 additions and 9 deletions
+4 -4
View File
@@ -54,11 +54,11 @@ stable)
;;
esac
# Never move onto a tree that predates the channel mechanism: its update
# command cannot switch back, stranding the install
if [[ ! -f $src/bin/omarchy-cn-channel ]]; then
# Never move onto a tree that predates the channel or migrate mechanism:
# it cannot switch back or finish this update's migration step
if [[ ! -f $src/bin/omarchy-cn-channel || ! -f $src/bin/omarchy-cn-migrate ]]; then
git -C "$src" checkout -q "$old"
echo "$channel 通道的目标发布早于通道机制,已回退;请使用 nightly 或更新的发布" >&2
echo "$channel 通道的目标发布早于当前更新机制,已回退;请使用 nightly 或更新的发布" >&2
exit 1
fi
+3
View File
@@ -96,6 +96,9 @@ while IFS=$'\t' read -r name file marker; do
fi
done < <(migration_entries)
# Here (not omarchy-update) so the first update from a pre-cn package runs them
OMARCHY_PATH="$OMARCHY_PATH" omarchy-cn-migrate
# Clear a login-time notification the user left sitting there and then resolved
# by running migrations some other way. The substring matches both the current
# and legacy notification titles.
-1
View File
@@ -46,7 +46,6 @@ if [[ ${1:-} == "-y" ]] || omarchy-update-confirm; then
# takes the update with it rather than migrating against what is still on disk.
omarchy-update-system-pkgs
omarchy-migrate
omarchy-cn-migrate
omarchy-hook post-update
omarchy-update-aur-pkgs
omarchy-update-mise