-
Notifications
You must be signed in to change notification settings - Fork 15
/
update.sh
executable file
·73 lines (61 loc) · 1.66 KB
/
update.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
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
function update_ggwave () {
python_version=`python --version`
if [[ $python_version =~ ".11" ]]; then
echo "https://whl.smartgic.io/ggwave-0.4.2-cp311-cp311-linux_aarch64.whl" >> requirements.txt
fi
}
function create_requirements () {
if [[ -f requirements.txt ]]; then
rm requirements.txt
fi
OVOS_PACKAGES=$(pip list | grep -i ovos)
for w in ${OVOS_PACKAGES[@]}; do
if [[ $w =~ [0-9] ]]; then
continue
else
echo "updating $w"
if [[ "$w" =~ "ggwave" ]]; then
update_ggwave
fi
echo "$w" >> requirements.txt
fi
done
}
function install () {
case $1 in
--alpha)
pip install -r requirements.txt -U --pre
;;
*)
pip install -r requirements.txt -U
;;
esac
rm requirements.txt
}
clear
if [[ ! ${VIRTUAL_ENV} ]]; then
echo "You must be in your venv for this script to work."
echo "Please activate it and run this script again"
exit 1
fi
echo "This script will update the OVOS packages installed on this device."
echo
read -p "Would you like to continue? Y/n " response
if [[ "$response" =~ ^[Yy] ]]; then
create_requirements
else
echo "Installation aborted by the user."
exit 1
fi
echo
echo "Would you like to update to the latest Alpha packages?"
read -p "WARNING: These are not stable packages and change on a regular basis. Y/n " alpha_response
if [[ "$alpha_response" =~ ^[Yy] ]]; then
install --alpha
else
install
fi
echo
echo "All OVOS packages have been updated."
echo "Restart OVOS for the changes to take effect"