-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.bash
More file actions
executable file
·45 lines (34 loc) · 1.26 KB
/
install.bash
File metadata and controls
executable file
·45 lines (34 loc) · 1.26 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
#!/bin/bash
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/_bash_common.bash"
requirements_path="${SCRIPT_DIR}/requirements.txt"
if [ "${OSTYPE}" = "cygwin" ]; then
requirements_path="$(cygpath -w "${requirements_path}")"
fi
echo "🚀 Running GCM installer for Unix..."
if ! command -v python >/dev/null 2>&1; then
echo "❌ Python is not installed or is not in PATH."
exit 1
fi
if [ ! -d "${SCRIPT_DIR}/.venv" ]; then
echo "📦 Creating virtual environment .venv..."
python -m venv "${SCRIPT_DIR}/.venv" || exit 1
fi
echo "🐍 Activating virtual environment .venv..."
if [ -r "${SCRIPT_DIR}/.venv/bin/activate" ]; then
# shellcheck disable=SC1091
source "${SCRIPT_DIR}/.venv/bin/activate"
elif [ -r "${SCRIPT_DIR}/.venv/Scripts/activate" ]; then
# shellcheck disable=SC1091
source "${SCRIPT_DIR}/.venv/Scripts/activate"
else
echo "❌ Could not find the virtual environment activation script."
exit 1
fi
echo "🧪 Installing requirements within .venv..."
python -m pip install --upgrade pip >/dev/null || exit 1
python -m pip install -r "${requirements_path}" || exit 1
export MSYSTEM
export OSTYPE
gcm_run_repo_python "${SCRIPT_DIR}" "install.py" || exit 1
echo "✅ Complete installation."