Skip to content

Commit

Permalink
Use valet use to switch version (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
binotaliu authored Nov 30, 2021
1 parent d544e92 commit 7e4902c
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions phpswitch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,6 @@ if [[ " ${php_array[*]} " == *"$php_version"* ]]; then
# Check that the requested version is installed
if [[ " ${php_installed_array[*]} " == *"$php_version"* ]]; then

# Stop valet service
if [[ ($valet_installed -eq 1) && ($valet_restart -eq 1) ]]; then
echo "Stop Valet service"
valet stop
fi

# Switch Shell
echo "Switching to $php_version"
echo "Switching your shell"
Expand Down Expand Up @@ -159,9 +153,9 @@ $comment_apache_module_string\\

# Switch valet
if [[ $valet_restart -eq 1 ]]; then
if [[ valet_installed -eq 1 ]]; then
valet restart
else
if [[ $valet_installed -eq 1 ]]; then
valet use $php_version --force
else
echo "valet doesn't installed in your system, will skip restarting valet service"
fi
fi
Expand Down

0 comments on commit 7e4902c

Please sign in to comment.