-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshenv
43 lines (30 loc) · 1.01 KB
/
.zshenv
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
42
43
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Dotfiles installation
# Resolve DOTFILES_DIR (assuming ~/.dotfiles on distros without readlink and/or $BASH_SOURCE/$0)
READLINK=$(which greadlink 2>/dev/null || which readlink)
CURRENT_SCRIPT=$BASH_SOURCE
if [[ -n $CURRENT_SCRIPT && -x "$READLINK" ]]; then
SCRIPT_PATH=$($READLINK -f "$CURRENT_SCRIPT")
DOTFILES_DIR=$(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"
# Hook for extra/custom stuff
DOTFILES_EXTRA_DIR="$HOME/.extra"
if [ -d "$DOTFILES_EXTRA_DIR" ]; then
for EXTRAFILE in "$DOTFILES_EXTRA_DIR"/runcom/*.sh; do
[ -f "$EXTRAFILE" ] && . "$EXTRAFILE"
done
fi
# Clean up
unset READLINK CURRENT_SCRIPT SCRIPT_PATH DOTFILE EXTRAFILE
# Export
export DOTFILES_DIR DOTFILES_EXTRA_DIR
## ----------------- Custom config -----------------
. "$HOME/.cargo/env"