2025-06-25 16:47:23 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
cd ~/.local/share/omarchy
|
2025-06-28 11:46:28 -07:00
|
|
|
|
2025-06-29 12:49:51 -07:00
|
|
|
if [[ $1 == "all" ]]; then
|
|
|
|
# Run all migrations
|
|
|
|
last_updated_at=1
|
|
|
|
else
|
|
|
|
# Remember the version we're at before upgrading
|
|
|
|
last_updated_at=$(git log -1 --format=%cd --date=unix)
|
|
|
|
fi
|
2025-06-28 11:46:28 -07:00
|
|
|
|
2025-07-17 09:39:31 -07:00
|
|
|
# Get the latest while trying to preserve any modifications
|
2025-07-17 19:13:35 -07:00
|
|
|
git pull --autostash
|
2025-06-28 11:46:28 -07:00
|
|
|
|
|
|
|
# Run any pending migrations
|
|
|
|
for file in migrations/*.sh; do
|
|
|
|
filename=$(basename "$file")
|
|
|
|
migrate_at="${filename%.sh}"
|
|
|
|
|
|
|
|
if [ $migrate_at -gt $last_updated_at ]; then
|
2025-07-09 19:12:26 -04:00
|
|
|
echo -e "\e[32m\nRunning migration ($migrate_at)\e[0m"
|
2025-06-28 11:46:28 -07:00
|
|
|
source $file
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Back to where we came from
|
2025-06-29 12:49:51 -07:00
|
|
|
cd - >/dev/null
|
2025-07-09 18:33:06 -07:00
|
|
|
|
2025-07-17 09:39:42 -07:00
|
|
|
echo -e ""
|
|
|
|
gum confirm "Update system packages too?" && yay -Syu --noconfirm
|