Files
omarchy/bin/omarchy-update
David Heinemeier Hansson 3415fef297 Go back to just always updating system packages
Otherwise we can't depend on having the same minimum versions
2025-07-20 21:24:10 -05:00

31 lines
825 B
Bash
Executable File

#!/bin/bash
cd ~/.local/share/omarchy
if [[ $1 == "all" ]]; then
# Run all migrations since the root commit
migration_starting_point=$(git log --max-parents=0 --first-parent --format="%H")
else
# Remember the commit we're at before upgrading in order to only run new migrations
migration_starting_point=$(git log -1 --format=%H)
fi
# Get the latest while trying to preserve any modifications
git pull --autostash
git diff --check || git reset --merge
# Run any pending migrations
for file in $(git diff --name-only --diff-filter=A $migration_starting_point.. migrations/*.sh); do
filename=$(basename "$file")
migrate_at="${filename%.sh}"
echo -e "\e[32m\nRunning migration ($migrate_at)\e[0m"
source $file
done
# Back to where we came from
cd - >/dev/null
# Update system packages
yay -Syu --noconfirm