forked from webpro/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bash_profile
41 lines (29 loc) · 996 Bytes
/
.bash_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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# Resolve DOTFILES_DIR (assuming ~/.dotfiles on distros without readlink and/or $BASH_SOURCE/$0)
CURRENT_SCRIPT=$BASH_SOURCE
if [[ -n $CURRENT_SCRIPT && -x readlink ]]; then
SCRIPT_PATH=$(readlink -n $CURRENT_SCRIPT)
DOTFILES_DIR="${PWD}/$(dirname $(dirname $SCRIPT_PATH))"
elif [ -d "$HOME/.dotfiles" ]; then
DOTFILES_DIR="$HOME/.dotfiles"
else
echo "Unable to find dotfiles, exiting."
return
fi
# Make utilities available
PATH="$DOTFILES_DIR/bin:$PATH"
# Source the dotfiles (order matters)
for DOTFILE in "$DOTFILES_DIR"/system/.{function,function_*,path,env,exports,alias,fnm,grep,prompt,completion,fix,zoxide}; do
. "$DOTFILE"
done
if is-macos; then
for DOTFILE in "$DOTFILES_DIR"/system/.{env,alias,function}.macos; do
. "$DOTFILE"
done
fi
# Set LSCOLORS
eval "$(dircolors -b "$DOTFILES_DIR"/system/.dir_colors)"
# Wrap up
unset CURRENT_SCRIPT SCRIPT_PATH DOTFILE
export DOTFILES_DIR