ChristianLempa / dotfiles

This contain my personal config files. Here you'll find configs, customizations, themes, and whatever I need to personalize my Linux and mac OS experience.
MIT License
920 stars 316 forks source link

Older MacOS .bashrc/starship issue (with fix) #13

Closed UncleTallest closed 1 year ago

UncleTallest commented 1 year ago

It's probably not mission-critical to you, but I noticed an error on your .bashrc file. You'd probably only notice it on an older Mac as most newer ones default to Zsh as their shell.

Comparing it to your .zsh/.zshrc file shows what's wrong:

.bashrc

➜ cat .bashrc
# find out which distribution we are running on
LFILE="/etc/*-release"
MFILE="/System/Library/CoreServices/SystemVersion.plist"
_distro=$(awk '/^ID=/' /etc/*-release | awk -F'=' '{ print tolower($2) }')

.zshrc

➜ cat .zshrc
# find out which distribution we are running on
LFILE="/etc/*-release"
MFILE="/System/Library/CoreServices/SystemVersion.plist"
if [[ -f $LFILE ]]; then
  _distro=$(awk '/^ID=/' /etc/*-release | awk -F'=' '{ print tolower($2) }')
elif [[ -f $MFILE ]]; then
  _distro="macos"
fi

I can attest that the code in your .zshrc file works just fine in .bashrc, though I'm sure you already knew that.

ChristianLempa commented 1 year ago

Thanks, I don't use bash anymore, that's why I haven't noticed it. Deleted the files to avoid confusion.