Last active
November 12, 2024 14:18
-
-
Save rmpel/44e86bb0579caf998d19a771da542be8 to your computer and use it in GitHub Desktop.
php version switch for pipeline
This file contains 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 characters
#!/usr/bin/env bash | |
[ -z "$1" ] && echo example usage: $0 8.1 >&2 && exit 1 | |
[ ! -f /usr/bin/php${1} ] && echo "No support for this version" >&2 && ls -la /usr/bin/php* >&2 && exit 2 | |
cd ~/.local/bin | |
rm php | |
ln -s /usr/bin/php${1} php | |
hash -r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment