Skip to content

Instantly share code, notes, and snippets.

@rmpel
Last active November 12, 2024 14:18
Show Gist options
  • Save rmpel/44e86bb0579caf998d19a771da542be8 to your computer and use it in GitHub Desktop.
Save rmpel/44e86bb0579caf998d19a771da542be8 to your computer and use it in GitHub Desktop.
php version switch for pipeline
#!/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