Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit dd72fd0

Browse files
author
Antonios Papadakis
committed
Add Quit Options and Redirects in the Script
macOS
1 parent 469f51d commit dd72fd0

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

macos/install.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Pre-install setup (install version choice, brew install, decompress files, cd into directory, etc.)
44
function setup {
55
# Install All Dependencies
6-
read -p 'Which PHP version would you like to install?[latest-7.1/latest-7.2/latest-7.3/default: latest-7.4/latest-8.0/latest-master] ' PHPINSTALLVERSION
6+
read -p 'Which PHP version would you like to install?[latest-7.1/latest-7.2/latest-7.3/default: latest-7.4/latest-8.0/latest-master/q (quit)] ' PHPINSTALLVERSION
77
PHPINSTALLVERSION=${PHPINSTALLVERSION:-latest-7.4}
88

99
if [ "$PHPINSTALLVERSION" = latest-7.1 ]; then
@@ -32,10 +32,10 @@ function setup {
3232
cd latest-8.0 || exit
3333
elif [ "$INSTALLCHOICE" = n ] || [ "$INSTALLCHOICE" = N ]; then
3434
echo cancelling installation
35-
exit 130
35+
setup
3636
else
3737
echo invalid argument, exiting...
38-
exit 1
38+
setup
3939
fi
4040
elif [ "$PHPINSTALLVERSION" = latest-master ]; then
4141
read -p 'CAREFUL: This is a pre-release version and is in heavy development. Install this only if you want the latest bleeding-edge features. These may not have been tested thoroughly and should not be used in a production environment. Are you sure you want to install?[y/Y/default: n/N] ' INSTALLCHOICE
@@ -44,11 +44,16 @@ function setup {
4444
git checkout php-src
4545
elif [ "$INSTALLCHOICE" = n ] || [ "$INSTALLCHOICE" = N ]; then
4646
echo cancelling installation
47-
exit 130
47+
git chekout master
48+
setup
4849
else
4950
echo invalid argument, exiting...
50-
exit 1
51+
git checkout master
52+
setup
5153
fi
54+
elif [ "$PHPINSTALLVERSION" = q ] || [ "$PHPINSTALLVERSION" = quit ]; then
55+
echo cancelling installation
56+
exit 130
5257
fi
5358

5459
echo Installing Dependencies
@@ -131,12 +136,11 @@ function installCLI {
131136
echo Installing PHP-CLI
132137
sudo make install || exit
133138
echo Installed PHP-CLI
134-
git checkout master
135139
exit 0
136140
elif [ "$ERRORRESPONSE" = n ] || [ "$ERRORRESPONSE" = N ]; then
137141
echo cancelled installation
138142
git checkout master
139-
exit 130
143+
setup
140144
fi
141145
}
142146

0 commit comments

Comments
 (0)