-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
52 lines (36 loc) · 1.31 KB
/
install.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
set -o errexit
set -o pipefail
set -o nounset
# set -o xtrace
PS4='+ (${BASH_SOURCE[0]##*/} @ ${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
export RED='\033[0;31m'
export CYAN='\033[0;36m'
export NO_COLOR='\033[0m'
# https://stackoverflow.com/a/246128/6674256
root="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
##########################
kernel=$(uname --kernel-name)
machine=$(uname --machine)
if [[ ${machine} != 'x86_64' || ${kernel} != 'Linux'* ]]; then
bash ${root}/utilities/error.sh "not Linux x86_64"
exit 1
fi
##########################
if ! which conda; then
bash ${root}/utilities/error.sh "please install conda"
exit 1
fi
conda_environment="constraint-tools"
if [[ $CONDA_DEFAULT_ENV != ${conda_environment} ]]; then
bash ${root}/utilities/error.sh "conda environment ${conda_environment} does not exist or is not activated"
bash ${root}/utilities/error.sh "please issue the following commands:"
bash ${root}/utilities/info.sh "conda create --name ${conda_environment} python=3.9"
bash ${root}/utilities/info.sh "conda activate ${conda_environment}"
exit 1
fi
pip install --requirement ${root}/install/requirements.txt
##########################
mkdir --parents ${root}/bin
bash install/jq.sh ${root}
##########################
bash install/node.sh ${root}