bootstrap .bashrc_local and .bashrc_paths from example if missing

This commit is contained in:
Paul Trowbridge 2026-05-10 02:42:35 -04:00
parent d964af18cb
commit 399d71808a

View File

@ -60,9 +60,14 @@ migrate_and_link() {
local target=$1
local link_name=$2
if [[ ! -e "$target" && -f "$link_name" && ! -L "$link_name" ]]; then
echo "Migrating existing $link_name -> $target"
cp "$link_name" "$target"
if [[ ! -e "$target" ]]; then
if [[ -f "$link_name" && ! -L "$link_name" ]]; then
echo "Migrating existing $link_name -> $target"
cp "$link_name" "$target"
elif [[ -f "${target}_example" ]]; then
echo "Bootstrapping $target from example (fill in real values)"
cp "${target}_example" "$target"
fi
fi
create_symlink "$target" "$link_name"