Permalink
Browse files

Add command_exists function to base.plugin from http://stackoverflow.…

  • Loading branch information...
1 parent 23de53a commit 229aa833a2965581f549fceddc78e28317c53e63 @demula demula committed Mar 6, 2011
Showing with 5 additions and 8 deletions.
  1. +5 −8 plugins/base.plugin.bash
View
@@ -11,19 +11,11 @@ function myip {
echo "Your public IP is: ${bold_green} $res ${normal}"
}
-# Make a directory and immediately 'cd' into it
-
function mkcd(){
mkdir -p "$*"
cd "$*"
}
-# Search through directory contents with grep
-
-function lsgrep(){
- ls | grep "$*"
-}
-
# View man documentation in Preview
pman () {
man -t "${1}" | open -f -a $PREVIEW
@@ -77,6 +69,11 @@ function t() {
fi
}
+# Checks for existence of a command
+command_exists () {
+ type "$1" &> /dev/null ;
+}
+
# List all plugins and functions defined by bash-it
function plugins-help() {

0 comments on commit 229aa83

Please sign in to comment.