#!/usr/bin/env bash # Define paths as they have not been defined by new bashrc yet! PANAMA_PATH="${PANAMA_PATH:-$HOME/.local/share/Panama}" PANAMA_BASH="${PANAMA_BASH:-$PANAMA_PATH/config/bash}" # Backup existing .bashrc if it's a regular file if [ -f "$HOME/.bashrc" ] && [ ! -L "$HOME/.bashrc" ]; then mv "$HOME/.bashrc" "$PANAMA_BASH/.bashrc.bak" fi # Remove old symlink if it exists and points somewhere else if [ -L "$HOME/.bashrc" ]; then rm "$HOME/.bashrc" fi ln -s "$PANAMA_BASH/.bashrc" "$HOME/.bashrc"