bootstrap .bashrc_local and .bashrc_paths from example if missing
This commit is contained in:
parent
d964af18cb
commit
399d71808a
@ -60,9 +60,14 @@ migrate_and_link() {
|
||||
local target=$1
|
||||
local link_name=$2
|
||||
|
||||
if [[ ! -e "$target" && -f "$link_name" && ! -L "$link_name" ]]; then
|
||||
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"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user