Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use valet use to switch version #77

Merged
merged 1 commit into from
Nov 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -158,9 +152,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