Source commit: ffc6f14a3723ea6aa513613a5406d737f21b201d Public tree identity: sha256:a77575c31dda8de868bc8de91d94df55c46f0b028e755e56a8cce8e27f72a42b
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"
|