Skip to content

Instantly share code, notes, and snippets.

@pedroborges
Last active March 12, 2019 13:07
Show Gist options
  • Save pedroborges/f55ad40b24bdf77df87f24d8761f0a58 to your computer and use it in GitHub Desktop.
Save pedroborges/f55ad40b24bdf77df87f24d8761f0a58 to your computer and use it in GitHub Desktop.

Kirby 3 CLI

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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment