diff --git a/bin/omarchy-migrate b/bin/omarchy-migrate index f547570..a3c47e5 100755 --- a/bin/omarchy-migrate +++ b/bin/omarchy-migrate @@ -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