-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·57 lines (51 loc) · 1.68 KB
/
install
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
#!/bin/bash
# run this with one line:
# curl https://raw.githubusercontent.com/zackees/install.py/main/install -o install && bash ./install
set -e
kernelName="$(uname -s)"
# Get the directory of the current script
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
# Change to that directory
cd "$script_dir"
echo changed to $(pwd)
# Check if install.py exists, if not, download it
if [ ! -f "./install.py" ]; then
curl https://raw.githubusercontent.com/zackees/install.py/main/install.py -o ./install.py
else
echo "install.py already exists. Skipping download."
fi
if [ "$kernelName" == "Darwin" ]; then
# Check if Homebrew is installed
if command -v brew >/dev/null 2>&1; then
echo "Homebrew is installed. Continuing with installation."
brew install [email protected]
python3.11 -m venv venv
source venv/bin/activate
ls -al
pwd
python ./install.py
echo "finished macos install"
exit 0
else
echo "Error: Homebrew is not installed. Please install Homebrew and rerun this script."
exit 1
fi
elif [ "$kernelName" == "Linux" ]; then
sudo apt-get install python3.11 python3.11-venv
python3.11 -m venv venv
source venv/bin/activate
python ./install.py
echo "finished linux install"
exit 0
elif [[ "$kernelName" == CYGWIN* ]] || [[ "$kernelName" == MINGW32* ]] || [[ "$kernelName" == MSYS* ]] || [[ "$kernelName" == MINGW* ]]; then
echo "Windows OS detected"
python -m venv venv
source venv/Scripts/activate
python install.py
echo "finished windows install"
exit 0
else
# Error
echo "Unknown operating system: $kernelName"
exit 1
fi