diff --git a/install_nvchad.sh b/install_nvchad.sh index d19e8de..7c80d5d 100755 --- a/install_nvchad.sh +++ b/install_nvchad.sh @@ -50,10 +50,16 @@ echo "" # If already installed and pointing at the right remote, just pull if [ -d "$NVIM_CONFIG/.git" ]; then - EXISTING_REMOTE=$(git -C "$NVIM_CONFIG" remote get-url hptrow 2>/dev/null || git -C "$NVIM_CONFIG" remote get-url origin 2>/dev/null || echo "") + REMOTE_NAME="" + if git -C "$NVIM_CONFIG" remote get-url hptrow &>/dev/null; then + REMOTE_NAME="hptrow" + elif git -C "$NVIM_CONFIG" remote get-url origin &>/dev/null; then + REMOTE_NAME="origin" + fi + EXISTING_REMOTE=$(git -C "$NVIM_CONFIG" remote get-url "$REMOTE_NAME" 2>/dev/null || echo "") if [ "$EXISTING_REMOTE" = "$REPO" ]; then echo "NvChad config already installed — pulling latest..." - git -C "$NVIM_CONFIG" pull hptrow "$BRANCH" + git -C "$NVIM_CONFIG" pull "$REMOTE_NAME" "$BRANCH" deploy_nvim_modules echo "Done." exit 0