From d973665df02737e3dc7f33b83bc1ad64a90f605e Mon Sep 17 00:00:00 2001 From: Colin Shea Date: Sun, 27 Nov 2011 03:51:35 -0700 Subject: [PATCH] sprunge command has a setting! --- plugins/sprunge/sprunge.plugin.zsh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index ca7e77b33..4532e96de 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -1,8 +1,17 @@ -# A simple alias for sprunge, but only if there isn't a smarter, better one out -# there in $PATH +# Smart sprunge alias/script. # -# A good one to add is the sprunge script in this directory. +# To add the sprunge script to your path, add this to your .zshrc file: +# +# zstyle :omz:plugins:sprunge add-path on +# +# Otherwise, a simple alias for sprunge, but only if there isn't a smarter, +# better one out there in $PATH, will be added. -if [ -z "${commands[sprunge]}" ]; then +zstyle -b :omz:plugins:sprunge add-path _plugin__path +if [[ ${_plugin__path} == "on" ]]; then + # Plugin setting: Add this plugin directory to the path + export PATH=$PATH:$ZSH/plugins/sprunge +elif [ -z "${commands[sprunge]}" ]; then + # Nope. No `sprunge` command, period. So, dumb/simple alias, here we go! alias sprunge="curl -F 'sprunge=<-' http://sprunge.us/" fi