Last active
May 7, 2016 00:49
-
-
Save soberstadt/0a8bf7ed787fef046d6f7686d62dc5ef to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env bash | |
# Happy Birthday, Jordan! I hope this can help make your day extra special! | |
# so this will make your Terminal's "Command not found" messages a little | |
# more fun. Examples: | |
# $ bundler install | |
# bundler? I hardly know her! | |
# $ gem spec | |
# What is this gem you speak of? | |
# install by dumping somehwhere like ~/bin and then activate with adding | |
# `source ~/bin/silly_command_not_found.sh` to either .bashrc or .zshrc | |
silly_not_found() { | |
local cmd="$1" | |
if [[ "$cmd" =~ .+er$ ]] | |
then | |
echo "$cmd? I hardly know her!" | |
else | |
echo "What is this $cmd you speak of?" | |
fi | |
} | |
if [ -n "$BASH_VERSION" ]; then | |
command_not_found_handle() { | |
silly_not_found $* | |
return $? | |
} | |
elif [ -n "$ZSH_VERSION" ]; then | |
command_not_found_handler() { | |
silly_not_found $* | |
return $? | |
} | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment