-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup
executable file
·70 lines (58 loc) · 1.62 KB
/
setup
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
#!/usr/bin/env bash
ROOT_DIR=$(readlink -f $(dirname $0))
REQUIRED_PACKAGES=""
REQUIRED_PACKAGES="$REQUIRED_PACKAGES jq"
REQUIRED_PACKAGES="$REQUIRED_PACKAGES moreutils"
function inst_autoteamaker-gui() {
which nodejs >&/dev/null || {
# Raspberry Pi default nodejs is not new enough
# Use the official installation methond instead:
# https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
}
( cd $ROOT_DIR/gui || exit
PATH="./node_modules/.bin/:$PATH" which electron >&/dev/null || {
npm install
npm run build
npm run build:linux
}
)
local autostart_file="$HOME/.config/autostart/autoteamaker.desktop"
[ -e "$autostart_file" ] || {
install -D /dev/null "$autostart_file"
cat >$autostart_file <<EOD
[Desktop Entry]
Name=autoteamaker GUI
Exec=$HOME/autoteamaker/autoteamaker-gui
EOD
}
local desktop_shortcut="$HOME/Desktop/autoteamaker.desktop"
[ -e "$desktop_shortcut" ] || {
install -D /dev/null "$desktop_shortcut"
cat >$desktop_shortcut <<EOD
[Desktop Entry]
Name=autoteamaker GUI
Type=Application
Terminal=false
Icon=$HOME/autoteamaker/gui/favicon.png
Exec=$HOME/autoteamaker/autoteamaker-gui
Path=$HOME/autoteamaker/
EOD
}
}
function inst_pymlx09614() {
pip install PyMLX90614
}
function main() {
[ "$(lsb_release -i -s 2>/dev/null)" = "Raspbian" ] || {
echo "[SKIP] This system is not Raspberry Pi OS, do nothing..."
return 1
}
sudo apt update
sudo apt upgrade -y
sudo apt install -y $REQUIRED_PACKAGES
inst_autoteamaker-gui
inst_pymlx09614
}
main