Skip to content

Commit 0ab13e8

Browse files
committed
Update install.command
Update install.command to be compatible with modern Mac versions.
1 parent 1dc71f5 commit 0ab13e8

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Diff for: installation/MacOs/install.command

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Simple installation script for MacOS
2+
kernel=$(uname -s)
23

3-
if [ $kernel != "Darwin" ]; then
4+
if [ "${kernel:-}" != "Darwin" ]; then
45
echo "Non MacOS System detected, please use the right installtion file for your system"
56
else
67
DONE_STEPS=0
78

89
# Check if Python is installed
9-
if command -v python &>/dev/null; then
10+
if command -v python3 &>/dev/null; then
1011
echo "Python is installed"
11-
DONE_STEPS=`expr $DONE_STEPS + 1`
12+
DONE_STEPS=$((DONE_STEPS + 1))
1213
else
1314
echo "Please install the latest version of Python from https://www.python.org/downloads/"
1415
echo
@@ -18,22 +19,22 @@ else
1819
echo "===================="
1920

2021
# Check if pip is installed
21-
if command -v pip &>/dev/null; then
22+
if command -v pip3 &>/dev/null; then
2223
echo Pip is installed
23-
DONE_STEPS=`expr $DONE_STEPS + 1`
24+
DONE_STEPS=$((DONE_STEPS + 1))
2425
else
2526
echo "Installing pip..."
2627
curl https://bootstrap.pypa.io/get-pip.py > get-pip.py
2728

2829
# Asking for PW for user installation
2930
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
3132
rm get-pip.py
3233

3334
# Check if it's installed now
34-
if command -v pip &>/dev/null; then
35+
if command -v pip3 &>/dev/null; then
3536
echo "Pip has been successfilly installed"
36-
DONE_STEPS=`expr $DONE_STEPS + 1`
37+
DONE_STEPS=$((DONE_STEPS + 1))
3738
else
3839
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"
3940
echo
@@ -47,7 +48,7 @@ else
4748
CHROMEPATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
4849
if [ -x "$CHROMEPATH" ]; then
4950
echo "Chrome is installed"
50-
DONE_STEPS=`expr $DONE_STEPS + 1`
51+
DONE_STEPS=$((DONE_STEPS + 1))
5152
else
5253
echo "Please make sure that Chrome is installed. If not, please install the latest version of Chrome from https://www.google.com/chrome/"
5354
echo
@@ -64,8 +65,7 @@ else
6465
echo "===================="
6566

6667
# Checking if it was installed
67-
PIP_INSTALLS="$(pip list)"
68-
if [[ $PIP_INSTALLS = *"instapy"* ]]; then
68+
if pip3 show instapy &>/dev/null; then
6969
echo "Successfully installed InstaPy!"
7070
else
7171
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

Comments
 (0)