Skip to content

Instantly share code, notes, and snippets.

@theMadness
Created June 2, 2017 22:07
Show Gist options
  • Save theMadness/2f88819def701695ee4adb872f14f873 to your computer and use it in GitHub Desktop.
Save theMadness/2f88819def701695ee4adb872f14f873 to your computer and use it in GitHub Desktop.
#!/bin/bash
declare -r php_path=/usr/local/bin/php
if [ -h "$php_path" ]
then
[[ "$(readlink $php_path)" =~ /(php[0-9]{2})/ ]] && brew unlink ${BASH_REMATCH[1]}
else
echo "$php_path is not a symlink"
fi
valet stop
brew link php$1
valet install
valet restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment