From b2678621c96125f0cf97796e53ded4fca47083de Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Fri, 20 Jul 2012 09:35:41 -0700 Subject: [PATCH] Script of shell helper functions --- shell-functions | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 shell-functions diff --git a/shell-functions b/shell-functions new file mode 100644 index 0000000..403cd53 --- /dev/null +++ b/shell-functions @@ -0,0 +1,13 @@ +#!/bin/zsh +# vim: ft=zsh +# Helper functions for the init files +# Eryn Wells + + +# Print prettier, more uniform messages +function print_msg { print -P "%F{$1}==>%f $2" } +function print_info { print_msg 'blue' "$@" } +function print_error { print_msg 'red' "$@" } + +# Return 1 if the binary exists (according to hash); 0 otherwise. +function binary_exists { return $(hash $1 1>/dev/null 2>&1) }