-
-
Notifications
You must be signed in to change notification settings - Fork 44
/
setup.sh
30 lines (26 loc) · 857 Bytes
/
setup.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
#!/bin/bash
abort() {
printf "%s\n" "$@" >&2
exit 1
}
execute() {
if ! "$@"
then abort "$(printf "Failed: %s" "$@")"
fi
}
execute_root() {
execute "sudo" "$@"
}
echo "Installing Python..."
execute_root "wget" "-O" "python-install.sh" "https://raw.githubusercontent.com/ProjectNeura/LEADS/main/scripts/python-install.sh"
execute_root "/bin/bash" "python-install.sh"
echo "Cleaning up..."
execute_root "rm" "python-install.sh"
echo "Installing dependencies..."
execute_root "pip-leads" "install" "Pillow" "PySDL2" "customtkinter" "gpiozero" "lgpio" "pynmea2" "pynput" "pysdl2-dll" "pyserial" "leads"
echo "Creating Shortcut..."
execute_root "echo" "#!/bin/bash" > "/bin/leads-vec"
execute_root "echo" 'python-leads -m leads_vec "$@"' >> "/bin/leads-vec"
execute_root "chmod" "+x" "/bin/leads-vec"
echo "Verifying..."
execute "leads-vec" "info"