harmonize with coredesktop
This commit is contained in:
@@ -56,6 +56,29 @@ enable_services() {
|
||||
done
|
||||
}
|
||||
|
||||
# Run each script in migrations/ that hasn't succeeded on this machine yet, in
|
||||
# order, and record it once it does. Stops at the first failure so later
|
||||
# migrations can rely on earlier ones; it runs again on the next update.
|
||||
run_migrations() {
|
||||
local dir="${MINISERVER:-$HOME/.local/share/MiniServer}/migrations"
|
||||
local state="$HOME/.local/state/miniserver/migrations"
|
||||
local file name
|
||||
|
||||
mkdir -p "$state"
|
||||
for file in "$dir"/*.sh; do
|
||||
[ -f "$file" ] || continue
|
||||
name="$(basename "$file")"
|
||||
[ -f "$state/$name" ] && continue
|
||||
|
||||
echo "Running migration $name..."
|
||||
if ! bash "$file"; then
|
||||
echo "Migration $name failed; it will run again on the next update."
|
||||
return 1
|
||||
fi
|
||||
touch "$state/$name"
|
||||
done
|
||||
}
|
||||
|
||||
# Output of the last update's pacman -Su, written by updates.d/10-pacman.sh
|
||||
PACMAN_UPDATE_LOG="$HOME/.local/state/miniserver/pacman-update.log"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user