2025-08-02 22:07:42 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2025-08-03 14:09:07 +02:00
|
|
|
# Where we store an empty file for each migration that has already been performed.
|
2025-08-02 22:07:42 +02:00
|
|
|
STATE_DIR="$HOME/.local/state/omarchy/migrations"
|
|
|
|
mkdir -p "$STATE_DIR"
|
|
|
|
|
|
|
|
# Run any pending migrations
|
2025-08-03 14:07:39 +02:00
|
|
|
for file in ~/.local/share/omarchy/migrations/*.sh; do
|
2025-08-02 22:07:42 +02:00
|
|
|
filename=$(basename "$file")
|
|
|
|
|
2025-08-03 14:07:39 +02:00
|
|
|
if [[ ! -f "$STATE_DIR/$filename" ]]; then
|
|
|
|
echo -e "\e[32m\nRunning migration (${filename%.sh})\e[0m"
|
|
|
|
source $file
|
|
|
|
touch "$STATE_DIR/$filename"
|
|
|
|
fi
|
2025-08-02 22:07:42 +02:00
|
|
|
done
|