-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·61 lines (51 loc) · 1.26 KB
/
build.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
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# This build script is a precursor to run the build.py build script
check_python3() {
check_homebrew
if command -v python3 &> /dev/null
then
echo "Python3 is already installed."
else
echo "Python3 is not installed. Installing..."
install_python3
fi
}
check_homebrew() {
if command -v brew &> /dev/null
then
echo "Homebrew is already installed."
else
echo "Homebrew is not installed."
install_homebrew
fi
}
install_homebrew() {
echo "Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
}
install_python3() {
echo "Installing Python3..."
if command -v brew &> /dev/null
then
brew install python
else
echo "Homebrew is not installed. Please install homebrew before installing."
exit 1
fi
}
run_build() {
echo "Running build.py with python3..."
python3 ./build.py
}
# Main script execution
check_python3
run_build
# Check if python exists
# If exists run build.py
# If not exists check if homebrew exists
# If exists install python3
# Run build.py
# If not exists install homebrew with curl
# If failure exit
# If success install python3
# Run build.py