mirror of
https://github.com/basecamp/omarchy.git
synced 2025-07-27 12:19:24 +00:00
32 lines
628 B
Bash
Executable File
32 lines
628 B
Bash
Executable File
#!/bin/bash
|
|
|
|
cd ~/.local/share/omarchy
|
|
|
|
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
|
|
|
|
# Get the latest
|
|
git pull
|
|
|
|
# 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
|
|
echo -e "\e[32m\nRunning migration ($migrate_at)\e[0m"
|
|
source $file
|
|
fi
|
|
done
|
|
|
|
# Back to where we came from
|
|
cd - >/dev/null
|
|
|
|
echo -e "\e[32m\nUpdating system packages\e[0m"
|
|
yay -Syu --noconfirm
|