mirror of
https://github.com/basecamp/omarchy.git
synced 2025-08-04 07:39:24 +00:00
Simplify migrations script
This commit is contained in:
@ -8,19 +8,13 @@ STATE_DIR="$HOME/.local/state/omarchy/migrations"
|
||||
mkdir -p "$STATE_DIR"
|
||||
|
||||
# Run any pending migrations
|
||||
cd ~/.local/share/omarchy
|
||||
|
||||
for file in migrations/*.sh; do
|
||||
for file in ~/.local/share/omarchy/migrations/*.sh; do
|
||||
filename=$(basename "$file")
|
||||
migrate_at="${filename%.sh}"
|
||||
|
||||
# Migration already applied, to re-run it simply delete the state file and try again
|
||||
[ -e "${STATE_DIR}/$filename" ] && continue
|
||||
|
||||
echo -e "\e[32m\nRunning migration (${filename%.sh})\e[0m"
|
||||
source $file
|
||||
touch "${STATE_DIR}/$filename"
|
||||
if [[ ! -f "$STATE_DIR/$filename" ]]; then
|
||||
echo -e "\e[32m\nRunning migration (${filename%.sh})\e[0m"
|
||||
source $file
|
||||
touch "$STATE_DIR/$filename"
|
||||
fi
|
||||
done
|
||||
|
||||
# Back to where we came from
|
||||
cd - >/dev/null
|
||||
|
Reference in New Issue
Block a user