Harden Noble build and configuration lifecycle

This commit is contained in:
wuyang
2026-07-27 13:56:31 +08:00
parent 1b0af7b3ff
commit fd0fcd3437
5 changed files with 35 additions and 12 deletions
+4 -1
View File
@@ -4,9 +4,12 @@ set -euo pipefail
config_home="${XDG_CONFIG_HOME:-$HOME/.config}"
state_home="${XDG_STATE_HOME:-$HOME/.local/state}"
backup_root="$state_home/niri-beyond-glass/backups"
original_root="$state_home/niri-beyond-glass/original"
latest=""
if [[ -d "$backup_root" ]]; then
if [[ -e "$original_root/.captured" ]]; then
latest="$original_root"
elif [[ -d "$backup_root" ]]; then
latest="$(find "$backup_root" -mindepth 1 -maxdepth 1 -type d -printf '%p\n' | sort | tail -n 1)"
fi