Add the function below to your ~/.bashrc
or ~/.zshrc
file.
Usage:
kirby <branch>
kirby <tag>
function kirby() { | |
local branch="${1:-master}" | |
if [ -d kirby ]; then | |
echo "\033[32m⚠️ Kirby is already installed.\033[0m"; | |
echo "\033[32m Would you like to reinstall it?\033[0m"; | |
select answer in "Yes" "No"; do | |
case $answer in | |
Yes) break;; | |
No) return 0;; | |
esac | |
done | |
fi | |
echo "\033[32m⬢ Downloading Kirby ($branch)...\033[0m"; | |
curl -sL https://github.com/getkirby/kirby/archive/$branch.tar.gz | tar xz | |
rm -rf kirby && mv -i kirby-$branch kirby | |
} |