Source commit: 6756e5208c8b79e83d55610251430bc1baef53a3 Public tree identity: sha256:2f58837c3759b4f466cbc274571ee71bc0d24c7552dc009c186394e99123da87
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"
|