forked from conda/constructor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpre_install.sh
More file actions
34 lines (31 loc) · 1.22 KB
/
Copy pathpre_install.sh
File metadata and controls
34 lines (31 loc) · 1.22 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
#!/bin/bash
set -euxo pipefail
# the ^u here will cause unbound variables to cause errors
# we use that to test whether these vars are set or not; they should!
echo "INSTALLER_NAME=${INSTALLER_NAME}"
echo "INSTALLER_VER=${INSTALLER_VER}"
echo "INSTALLER_PLAT=${INSTALLER_PLAT}"
echo "INSTALLER_TYPE=${INSTALLER_TYPE}"
echo "INSTALLER_UNATTENDED=${INSTALLER_UNATTENDED}"
echo "CUSTOM_VARIABLE_1=${CUSTOM_VARIABLE_1}"
echo "CUSTOM_VARIABLE_2=${CUSTOM_VARIABLE_2}"
echo "PREFIX=${PREFIX}"
test "${INSTALLER_NAME}" = "Scripts"
test "${INSTALLER_VER}" = "1.0.0"
# shellcheck disable=SC2016 # String interpolation disabling is deliberate
test "${CUSTOM_VARIABLE_1}" = 'FIR$T-CUSTOM_'\''STRING'\'' WITH SPACES AND @*! "CHARACTERS"'
# shellcheck disable=SC2016 # String interpolation disabling is deliberate
test "${CUSTOM_VARIABLE_2}" = '$ECOND-CUSTOM_'\''STRING'\'' WITH SPACES AND @*! "CHARACTERS"'
if [[ "${INSTALLER_TYPE}" == "SH" ]]; then
test "${INSTALLER_UNATTENDED}" = "1"
fi
if [[ $(uname -s) == Linux ]]; then
if [[ ${INSTALLER_PLAT} != linux-* ]]; then
exit 1
fi
else # macOS
if [[ ${INSTALLER_PLAT} != osx-* ]]; then
exit 1
fi
fi
echo "Added by pre-install script" > "$PREFIX/pre_install_sentinel.txt"