|
1 | 1 | # Simple installation script for MacOS |
| 2 | +kernel=$(uname -s) |
2 | 3 |
|
3 | | -if [ $kernel != "Darwin" ]; then |
| 4 | +if [ "${kernel:-}" != "Darwin" ]; then |
4 | 5 | echo "Non MacOS System detected, please use the right installtion file for your system" |
5 | 6 | else |
6 | 7 | DONE_STEPS=0 |
7 | 8 |
|
8 | 9 | # Check if Python is installed |
9 | | - if command -v python &>/dev/null; then |
| 10 | + if command -v python3 &>/dev/null; then |
10 | 11 | echo "Python is installed" |
11 | | - DONE_STEPS=`expr $DONE_STEPS + 1` |
| 12 | + DONE_STEPS=$((DONE_STEPS + 1)) |
12 | 13 | else |
13 | 14 | echo "Please install the latest version of Python from https://www.python.org/downloads/" |
14 | 15 | echo |
|
18 | 19 | echo "====================" |
19 | 20 |
|
20 | 21 | # Check if pip is installed |
21 | | - if command -v pip &>/dev/null; then |
| 22 | + if command -v pip3 &>/dev/null; then |
22 | 23 | echo Pip is installed |
23 | | - DONE_STEPS=`expr $DONE_STEPS + 1` |
| 24 | + DONE_STEPS=$((DONE_STEPS + 1)) |
24 | 25 | else |
25 | 26 | echo "Installing pip..." |
26 | 27 | curl https://bootstrap.pypa.io/get-pip.py > get-pip.py |
27 | 28 |
|
28 | 29 | # Asking for PW for user installation |
29 | 30 | echo "Please insert your password in order to install pip" |
30 | | - sudo python get-pip.py |
| 31 | + sudo python3 get-pip.py && rm get-pip.py |
31 | 32 | rm get-pip.py |
32 | 33 |
|
33 | 34 | # Check if it's installed now |
34 | | - if command -v pip &>/dev/null; then |
| 35 | + if command -v pip3 &>/dev/null; then |
35 | 36 | echo "Pip has been successfilly installed" |
36 | | - DONE_STEPS=`expr $DONE_STEPS + 1` |
| 37 | + DONE_STEPS=$((DONE_STEPS + 1)) |
37 | 38 | else |
38 | 39 | echo "Pip could not be installed, please manually install pip using this resource: https://stackoverflow.com/questions/17271319/how-do-i-install-pip-on-macos-or-os-x" |
39 | 40 | echo |
|
47 | 48 | CHROMEPATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" |
48 | 49 | if [ -x "$CHROMEPATH" ]; then |
49 | 50 | echo "Chrome is installed" |
50 | | - DONE_STEPS=`expr $DONE_STEPS + 1` |
| 51 | + DONE_STEPS=$((DONE_STEPS + 1)) |
51 | 52 | else |
52 | 53 | echo "Please make sure that Chrome is installed. If not, please install the latest version of Chrome from https://www.google.com/chrome/" |
53 | 54 | echo |
|
64 | 65 | echo "====================" |
65 | 66 |
|
66 | 67 | # Checking if it was installed |
67 | | - PIP_INSTALLS="$(pip list)" |
68 | | - if [[ $PIP_INSTALLS = *"instapy"* ]]; then |
| 68 | + if pip3 show instapy &>/dev/null; then |
69 | 69 | echo "Successfully installed InstaPy!" |
70 | 70 | else |
71 | 71 | echo "There was a problem installing InstaPy, please copy the error message and create an issue here: https://github.com/InstaPy/instapy-quickstart/issues" |
|
0 commit comments