Source commit: f8ee5fc25a1d0fed1e59b3f34d534b395bf34dad Public tree identity: sha256:a428db3c520f7c0779135e36a841a5102ed26070519b696a146dbfa54514bd52
22 lines
659 B
Bash
Executable file
22 lines
659 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
migrate_path() {
|
|
local source="$1"
|
|
local destination="$2"
|
|
if [[ ! -e "$source" ]]; then
|
|
return
|
|
fi
|
|
if [[ -e "$destination" ]]; then
|
|
printf 'refusing to overwrite existing destination: %s\n' "$destination" >&2
|
|
exit 1
|
|
fi
|
|
mv -- "$source" "$destination"
|
|
printf 'migrated %s -> %s\n' "$source" "$destination"
|
|
}
|
|
|
|
migrate_path "${HOME}/.disasmer" "${HOME}/.clusterflux"
|
|
migrate_path "${XDG_CONFIG_HOME:-${HOME}/.config}/disasmer" \
|
|
"${XDG_CONFIG_HOME:-${HOME}/.config}/clusterflux"
|
|
migrate_path "${PWD}/.disasmer" "${PWD}/.clusterflux"
|
|
migrate_path "${PWD}/disasmer.toml" "${PWD}/clusterflux.toml"
|