Skip to content

Instantly share code, notes, and snippets.

@ozmos
Created January 6, 2022 10:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ozmos/94097c31b99801ae0fd92198e7bea175 to your computer and use it in GitHub Desktop.
Save ozmos/94097c31b99801ae0fd92198e7bea175 to your computer and use it in GitHub Desktop.
A simple fish script to change php versions in devilbox
function switch_php
set input_file ~/devilbox/.env
if grep 'PHP_SERVER='$argv $input_file
sed -i 's/^PHP_SERVER/#PHP_SERVER/' $input_file
sed -i 's/^#PHP_SERVER='$argv'/PHP_SERVER='$argv'/' $input_file
grep '^PHP_SERVER*' $input_file
else
echo "There is no container for PHP " $argv
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment