forked from pimoroni/unicorn-hat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·55 lines (46 loc) · 1.25 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
#!/bin/bash
echo ""
echo "This script will install Unicorn Hat libraries"
echo "and dependencies for both Python 2 and 3."
echo ""
echo "This process may take several minutes."
echo ""
echo "--- Warning ---"
echo ""
echo "Always be careful when running scripts and commands"
echo "copied from the internet. Ensure they are from a"
echo "trusted source."
echo ""
echo "If you want to see what this script does before"
echo "running it, you should run:"
echo " \curl -sS get.pimoroni.com/unicornhat"
echo ""
echo ""
read -r -p "Do you wish to continue? [y/N] " response < /dev/tty
response=${response,,}
if [[ $response =~ ^(yes|y)$ ]]
then
echo ""
echo "Updating package indexes..."
sudo apt-get update
echo ""
echo "Installing UnicornHat requirements..."
sudo apt-get --yes --force-yes install python-pip python3-pip python-dev python3-dev
echo ""
echo "Installing UnicornHat for Python 2..."
sudo pip install unicornhat
echo ""
echo "Installing UnicornHat for Python 3..."
sudo pip-3.2 install unicornhat
echo ""
echo "All done!"
echo "For examples"
echo "see https://github.com/pimoroni/UnicornHat/tree/master/python/examples"
echo "And visit forums.pimoroni.com for support"
echo "Have fun!"
echo ""
else
echo ""
echo "Aborting..."
echo ""
fi