-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_termux.sh
More file actions
executable file
·93 lines (82 loc) · 2.75 KB
/
install_termux.sh
File metadata and controls
executable file
·93 lines (82 loc) · 2.75 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/bash
# ============================================================================
# RegressionLab - Installation Script for Termux (Android)
# ============================================================================
# This script clones the repository and runs the setup for Termux
# ============================================================================
set -e # Exit on error
echo ""
echo "===================================="
echo " RegressionLab - Termux (Android)"
echo "===================================="
echo ""
# Check if running in Termux
if [ -z "$PREFIX" ] || [[ "$PREFIX" != *"com.termux"* ]]; then
echo "WARNING: This script is designed for Termux on Android."
echo "If you are not in Termux, consider using install.sh instead."
read -p "Continue anyway? (y/N): " CONTINUE
if [[ ! "$CONTINUE" =~ ^[Yy]$ ]]; then
exit 1
fi
fi
# [1/3] Check Git
echo "[1/3] Checking Git..."
if ! command -v git &> /dev/null; then
echo " Installing Git..."
pkg update
pkg install -y git
echo " Git installed"
fi
git --version
# Set repository URL
REPO_URL="https://github.com/DOKOS-TAYOS/RegressionLab.git"
REPO_NAME="regressionlab"
# IMPORTANT: Clone to Termux home (~) - NOT to shared storage (Downloads, etc).
# Android shared storage blocks symlinks, which Python venv needs for lib->lib64.
INSTALL_DIR="$HOME/$REPO_NAME"
cd "$HOME" || { echo "ERROR: Cannot access home directory"; exit 1; }
echo " Installing to: $INSTALL_DIR"
echo ""
# Check if directory already exists
if [ -d "$REPO_NAME" ]; then
echo ""
echo "WARNING: Directory '$REPO_NAME' already exists"
read -p "Do you want to remove it and clone again? (y/N): " OVERWRITE
if [[ "$OVERWRITE" =~ ^[Yy]$ ]]; then
echo " Removing existing directory..."
rm -rf "$REPO_NAME"
else
echo " Using existing directory..."
cd "$REPO_NAME"
chmod +x setup_termux.sh
bash setup_termux.sh
exit 0
fi
fi
# [2/3] Clone repository
echo ""
echo "[2/3] Cloning repository..."
if ! git clone "$REPO_URL" "$REPO_NAME"; then
echo "ERROR: Failed to clone repository"
echo "Please check your internet connection and try again"
exit 1
fi
echo " Repository cloned successfully"
# Change to repository directory
cd "$REPO_NAME" || {
echo "ERROR: Failed to change to repository directory"
exit 1
}
# [3/3] Run Termux setup
echo ""
echo "[3/3] Running Termux setup..."
chmod +x setup_termux.sh
bash setup_termux.sh
echo ""
echo "===================================="
echo " Installation Complete!"
echo "===================================="
echo ""
echo "The RegressionLab repository has been cloned and set up."
echo "You can now run the application from: $(pwd)"
echo ""