-
Notifications
You must be signed in to change notification settings - Fork 0
/
.path
24 lines (19 loc) · 789 Bytes
/
.path
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# Configure PATH environment variable for both Ubuntu and macOS
# Ensure OS_NAME is defined
[ -z "$OS_NAME" ] && OS_NAME=$(uname -s | tr '[:upper:]' '[:lower:]')
# Add Snap binaries for Ubuntu
# This adds Snap support if the system is Linux and /snap/bin exists
if [[ "$OS_NAME" == "linux" ]] && [[ -d /snap/bin ]]; then
export PATH=$PATH:/snap/bin
fi
# Add local binaries to PATH
# This ensures that binaries in the user's .local/bin are available
# Avoids duplicate entries and places it at the beginning of PATH for priority
[[ -d $HOME/.local/bin ]] && export PATH=${PATH/$HOME/.local/bin:}:$HOME/.local/bin
# Add user's private bin if it exists
# This is for any personal scripts or binaries
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
export PATH