-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall
More file actions
executable file
·28 lines (23 loc) · 839 Bytes
/
install
File metadata and controls
executable file
·28 lines (23 loc) · 839 Bytes
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
#!/bin/bash
# Mac does not necessarily have a realpath command, so we define it here
realpath(){
echo "$(cd $(dirname "$1");pwd)/$(basename "$1")"
}
# Get the init file
unamestr=`uname`
if [[ $SHELL == *"bash" ]]; then
if [[ "$unamestr" == 'Linux' ]]; then
DEFAULT_INIT="$HOME/.bashrc"
elif [[ "$unamestr" == 'Darwin' ]]; then
DEFAULT_INIT="$HOME/.bash_profile"
fi
elif [[ $SHELL == *"zsh" ]]; then
DEFAULT_INIT="$HOME/.zshrc"
fi
INIT_FILE=${INIT_FILE:-$DEFAULT_INIT}
ROOT="$(dirname $(realpath "$0"))"
echo "# Added by cluster-utils. Do not modify if you want automatic uninstall" >> "${INIT_FILE}"
echo "export CLUSTER_UTILS_ROOT=${ROOT}" >> "${INIT_FILE}"
echo "source \"\${CLUSTER_UTILS_ROOT}/activate\"" >> "${INIT_FILE}"
echo "# End of cluster-utils" >> "${INIT_FILE}"
touch "${ROOT}/.installed"