Created
April 8, 2015 02:18
-
-
Save rshipp/fffd6ab4ff53a3410939 to your computer and use it in GitHub Desktop.
An interactive shell for Betty - https://github.com/pickhardt/betty
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
#!/bin/bash | |
# interactive betty shell | |
BETTYSH_PS1=${BETTYSH_PS1:-betty$ } | |
install_betty() { | |
echo "==> Installing betty..." | |
git clone https://github.com/pickhardt/betty ~/.betty || return $? | |
echo "==> Done." | |
} | |
betty_repl() { | |
while read -p "$BETTYSH_PS1" instructions; do | |
$betty $instructions | |
done | |
} | |
die() { | |
echo "==> Fatal error! Exiting." | |
exit 1 | |
} | |
main() { | |
[[ -e ~/.betty ]] && export betty=~/.betty/main.rb || install_betty || die | |
betty_repl | |
} | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment