Created
April 13, 2023 15:12
-
-
Save mindfullsilence/c3965de4d1fabb4da26b4171cdde4ca8 to your computer and use it in GitHub Desktop.
Revisions
-
mindfullsilence created this gist
Apr 13, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ Add the function to your bash profile Ensure brew is installed Run it! Example: ```sh brewphus install 8.0 ``` ```sh brewphus use 8.0 # or brewphus switch 8.0 ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ function brewphus() { ACTION=$1 VERSION=$2 VERSION_STRING="shivammathur/php/php@${VERSION}" case $ACTION in install) brew update brew tap shivammathur/php brew install $VERSION_STRING ;; switch | use) OUTPUT="brew link --overwrite --force $VERSION_STRING" if ( ${OUTPUT} | grep 'Warning: Already linked' ); then brew unlink php $(OUTPUT) fi ;; *) echo 'You did not define an action. brewphus {upgrade|update} {version}' ;; esac }