-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathinstall.sh
More file actions
55 lines (45 loc) · 1.49 KB
/
install.sh
File metadata and controls
55 lines (45 loc) · 1.49 KB
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
51
52
53
54
55
#!/bin/sh
set -eu
# Detect the shell from which the script was called
parent=$(ps -o comm $PPID |tail -1)
parent=${parent#-} # remove the leading dash that login shells have
# Computing artifact location
case "$(uname)" in
Linux)
PLATFORM="linux" ;;
Darwin)
PLATFORM="macos" ;;
*NT*)
PLATFORM="windows" ;;
esac
RELEASE_URL="https://raw.githubusercontent.com/LAAC-LSCP/ChildProject/master/env_${PLATFORM}.yml"
# find environment manager
if hash micromamba >/dev/null 2>&1; then
ENV_MANAGER="micromamba"
elif hash conda >/dev/null 2>&1; then
ENV_MANAGER="conda"
else
echo "Neither micromamba nor conda was found, get micromamba at https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html" >&2
exit 1
fi
# find curl or wget
mkdir -p "${BIN_FOLDER}"
if hash curl >/dev/null 2>&1; then
HTTP_CMD="curl -o"
elif hash wget >/dev/null 2>&1; then
HTTP_CMD="wget -O"
else
echo "Neither curl nor wget was found" >&2
exit 1
fi
eval "${HTTP_CMD} /tmp/env.yml ${RELEASE_URL} && ${ENV_MANAGER} env create -f /tmp/env.yml"
if [ $? -ne 0 ]; then
echo "Installation of environment failed with code $?"
exit $?
case "$PLATFORM" in
macos)
brew install git-annex ;;
windows)
eval "${HTTP_CMD} /tmp/git-annex-installer.exe https://downloads.kitenet.net/git-annex/windows/current/git-annex-installer.exe && ./tmp/git-annex-installer.exe" ;;
esac
echo "Installation Completed for environment childproject, activate it with: \n${ENV_MANAGER} activate childproject"