diff options
| author | Ahmed Abdelhalim <[email protected]> | 2026-01-17 17:51:55 +0100 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2026-01-17 17:51:55 +0100 |
| commit | 110264439bdd4ccf4f2f3487dbd6eb873477a68e (patch) | |
| tree | cd9f2af94e0459f58b681d8c10a748eb6dce0f56 /.bash_profile | |
| parent | 1e2ee959ea38ef82ac06c9423d85ebf29cab7251 (diff) | |
Refactor .bash_profile to be more resilient/OS-specific
Diffstat (limited to '.bash_profile')
| -rw-r--r-- | .bash_profile | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/.bash_profile b/.bash_profile index 94e087b..0b87148 100644 --- a/.bash_profile +++ b/.bash_profile @@ -1,7 +1,23 @@ -#!/bin/bash -# shellcheck disable=SC1091 +#!/bin/bash +# shellcheck disable=SC1091 # Disables file doesn't exist warning +# macOS specific +if [[ "$OSTYPE" == darwin* ]]; then + # Homebrew Apple M1/Intel fixing of $PATH and loading bash_completion + if [ -d /opt/homebrew ]; then + eval "$(/opt/homebrew/bin/brew shellenv)" + source "/opt/homebrew/etc/bash_completion" + elif [ -d /usr/local/Homebrew ]; then + eval "$(/usr/local/Homebrew/bin/brew shellenv)" + source "/usr/local/Homebrew/etc/bash_completion" + fi + # Custom colors (not LS_COLORS as unix) defaultscheme "exfxcxdxbxegedabagacad" + export LSCOLORS=gxfxcxdxbxegedabagacad + # Silence new macOS warning about bash + export BASH_SILENCE_DEPRECATION_WARNING=1 +fi + if [ -f "$HOME/.profile" ]; then source "$HOME/.profile" fi @@ -10,17 +26,3 @@ fi if [ -f "$HOME/.bashrc" ]; then source "$HOME/.bashrc" fi - -# Homebrew Apple M1/Intel fixing of $PATH and loading bash_completion -if [ -d /opt/homebrew ]; then - eval "$(/opt/homebrew/bin/brew shellenv)" - source "/opt/homebrew/etc/bash_completion" -elif [ -d /usr/local/Homebrew ]; then - eval "$(/usr/local/Homebrew/bin/brew shellenv)" - source "/usr/local/Homebrew/etc/bash_completion" -fi - -# Mac OS custorm colors (not LS_COLORS as unix) defaultscheme "exfxcxdxbxegedabagacad" -export LSCOLORS=gxfxcxdxbxegedabagacad -# Silence new macOS warning about bash -export BASH_SILENCE_DEPRECATION_WARNING=1 |
