-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbashrc_macos
More file actions
executable file
·36 lines (31 loc) · 1.06 KB
/
Copy pathbashrc_macos
File metadata and controls
executable file
·36 lines (31 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# ============================================================
# bashrc_macos — macOS entry point
# Symlink or source this from ~/.bashrc or ~/.bash_profile
# ============================================================
# Source system-wide bashrc
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# --- Homebrew ---
if [ -z "$HOMEBREW_PREFIX" ]; then
if [ -f /opt/homebrew/bin/brew ]; then
eval "$(/opt/homebrew/bin/brew shellenv)" # Apple Silicon
elif [ -f /usr/local/bin/brew ]; then
eval "$(/opt/homebrew/bin/brew shellenv)" # Intel
fi
fi
# --- Bash Completion (Homebrew) ---
if [ -f /opt/homebrew/etc/profile.d/bash_completion.sh ]; then
. /opt/homebrew/etc/profile.d/bash_completion.sh
elif [ -f /usr/local/etc/profile.d/bash_completion.sh ]; then
. /usr/local/etc/profile.d/bash_completion.sh
fi
# --- macOS-specific PATH ---
case ":$PATH:" in
*":/usr/local/sbin:"*) ;;
*) export PATH="/usr/local/sbin:$PATH" ;;
esac
# --- Source the shared bashrc ---
if [ -f ~/dotfiles/bashrc ]; then
. ~/dotfiles/bashrc
fi