From e7674076632c02e38642194cdffadf14af0f4184 Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Thu, 20 Feb 2025 04:33:57 +0800 Subject: [PATCH] fix: amend bashrc to check for homebrew --- .bashrc | 17 ++++++++++------- .gitconfig | 1 + 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.bashrc b/.bashrc index 30bee2b..3dadf77 100644 --- a/.bashrc +++ b/.bashrc @@ -1,4 +1,3 @@ -eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)0 # Pull the latest changes from the remote (but only once!) if ! [ -v REPO_INITIALISED ]; then git pull origin main --quiet && export REPO_INITIALISED=true @@ -118,11 +117,15 @@ export PATH="$HOME/nvim/bin:$PATH" # Theming export PS1="\[\e[36m\]$(date +'%H:%M:%S')\[\e[32m\]$USER \[\e[35m\]\w \[\e[31m\]$ " -# Homebrew -eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" +# Homebrew (Linuxbrew) - Check if it exists first +if [ -f /home/linuxbrew/.linuxbrew/bin/brew ]; then + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" -# thefuck -eval $(thefuck --alias) + # thefuck + eval $(thefuck --alias) +fi -# Path setting -export PATH="$HOME/bin:$PATH" +# Path Setting - Make sure $HOME/bin exists and only add it once. +if [ -d "$HOME/bin" ] && ! echo "$PATH" | grep -q "$HOME/bin"; then + export PATH="$HOME/bin:$PATH" +fi diff --git a/.gitconfig b/.gitconfig index 0204694..2cd825f 100644 --- a/.gitconfig +++ b/.gitconfig @@ -9,3 +9,4 @@ autoSetupRemote = true [safe] directory = /appdata + directory = /storage/emulated/0/Obsidian Vaults/second-brain