helm/zsh/lib/util

23 lines
467 B
Plaintext
Raw Normal View History

# Check to see if a command exists
function command_exists {
command -v "$1" &> /dev/null
}
# log to a central logfile (specified by its caller globally)
function do_log {
printf "[%s] %s: %s" "$(`basename $BASH_SOURCE`)" "`date`" "$1" >> $logfile
}
# Check if a symlink exists before trying to create it
function do_link {
2013-03-23 00:44:56 -07:00
if [ -e "$2" ]; then
rm -rf "$2"
fi
if [ ! -e "$2" ]; then
ln -sf "$1" "$2"
fi
}
2013-03-22 18:10:59 -07:00
# vim:set ft=zsh: