Source commit: 01875e88a3e25379c309489f9f057dd97c0d37de Public tree identity: sha256:8f37a1aa0cc8f408975daf9cabbe193f8f4c169c6d25e8795e67a3ed5083c76b
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"
|