Skip to content

Instantly share code, notes, and snippets.

@itsthatguy
Last active August 29, 2015 14:07
Show Gist options
  • Select an option

  • Save itsthatguy/89f643f456d2c98d6b7e to your computer and use it in GitHub Desktop.

Select an option

Save itsthatguy/89f643f456d2c98d6b7e to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
function install_awesome {
local default="~/awesome.sh"
read -p "Where do you want to install these aliases? [$default]: " REPLY
REPLY=${REPLY:-$default}
echo -e "\n# INSTALLING THE AWESOME...
location: $REPLY\n"
echo -e "# Very important aliases
alias nyan='telnet nyancat.dakko.us'
alias starwars='telnet towel.blinkenlights.nl'
" >> `eval echo ${REPLY}`
reload_shell
}
function reload_shell {
local MSG="# RELOADING BASH..."
if [ -n "$ZSH_VERSION" ]; then
MSG="# RELOADING ZSH..."
[ -d "$HOME/.zshrc" ] && source .zshrc
elif [ -n "$BASH_VERSION" ]; then
[ -d "$HOME/.bashrc" ] && source .bashrc
[ -d "$HOME/.bash_profile" ] && source .bash_profile
else
MSG="# unknown shell... Manually reload your shell"
fi
echo -e "$MSG\n"
echo -e "# YOU'VE BEEN AWESOMED!"
echo -e "Use `nyan` or `starwars` and embrace the awesome!\n"
}
install_awesome
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment