-
Notifications
You must be signed in to change notification settings - Fork 0
/
env.sh
executable file
·34 lines (28 loc) · 660 Bytes
/
env.sh
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
#!/usr/bin/env sh
ENV_HOME="$(
cd "$(dirname "$0")" >/dev/null 2>&1 || exit
pwd -P
)"
export ENV_HOME
export PATH="$PATH:${ENV_HOME}/bin"
ENV_FILE="$ENV_HOME/.env"
if [ -f "$ENV_FILE" ]; then
. "$ENV_FILE"
fi
export ENV_FILE
. ~/.profile
. "$ENV_HOME"/scripts/aliases.sh
. "$ENV_HOME"/scripts/aliases-k8s.sh
. "$ENV_HOME"/scripts/aliases-docker.sh
. "$ENV_HOME"/scripts/functions.sh
HOST="$(hostname)"
export HOST
HOST_HOME="$ENV_HOME/hosts/$HOST"
if [ -n "$HOST" ] && [ -d "$HOST_HOME" ]; then
if [ -d "$HOST_HOME/bin" ]; then
export PATH="$PATH:$HOST_HOME/bin"
fi
if [ -f "$HOST_HOME/profile" ]; then
. "$HOST_HOME"/profile
fi
fi