-
Notifications
You must be signed in to change notification settings - Fork 8
/
env.bsh
executable file
·39 lines (30 loc) · 1.04 KB
/
env.bsh
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
#!/usr/bin/env bash
#A simple script for you to source to auto use this vsi common environment
if command -v unsetup_vsi_common &> /dev/null; then
unsetup_vsi_common
fi
PRE_VSI_COMMON_PATH="${PATH}"
if [ "${BASH_VERSION+set}" = "set" ]; then
# Use the real shell not for babies
export VSI_COMMON_DIR="$(\cd "$(dirname "${BASH_SOURCE[0]}")"; \pwd)"
function unsetup_vsi_common()
{
export PATH="${PRE_VSI_COMMON_PATH}"
complete -r just &> /dev/null
unset unsetup_vsi_common
}
source "${VSI_COMMON_DIR}/linux/elements.bsh"
IFS=: add_element_pre PATH "${VSI_COMMON_DIR}/linux"
source "${VSI_COMMON_DIR}/linux/just_files/.just"
elif [ "${ZSH_VERSION+set}" = "set" ]; then #Zsh
echo "NOTE zsh has limited functionality"
export VSI_COMMON_DIR="$(\cd "$(dirname "${0}")"; \pwd)"
function unsetup_vsi_common()
{
export PATH="${PRE_VSI_COMMON_PATH}"
unset unsetup_vsi_common
}
PATH="${VSI_COMMON_DIR}/linux":"${PATH}"
else
echo "Unsupported shell. Please use the bash shell (or zsh with limited functionality)"
fi