-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.profile
26 lines (25 loc) · 835 Bytes
/
.profile
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
#!/usr/bin/env sh
#echo ~/.profile
# Add XDG Base Directory Specification to MacOs
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$(getconf DARWIN_USER_CACHE_DIR)}"
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
export XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}"
export XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
export XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-$(getconf DARWIN_USER_TEMP_DIR)}"
# Helper function allows safely modifying $PATH environment variable.
function pathmunge() {
case ":${PATH}:" in
# Do not add the same path twice.
*:"$1":*)
;;
*)
if [ "$2" = "after" ] ; then
# Append to $PATH.
PATH=$PATH:$1
else
# Prepend to $PATH.
PATH=$1:$PATH
fi
esac
}