From c5404482a516d7b697afa700cccbca94151c11bb Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 17:06:13 -0500 Subject: [PATCH] Its better practise to use [[ and ]] rather than [ and ] --- plugins/sprunge/sprunge.plugin.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/sprunge/sprunge.plugin.zsh b/plugins/sprunge/sprunge.plugin.zsh index 208e381e7..32da7b12f 100644 --- a/plugins/sprunge/sprunge.plugin.zsh +++ b/plugins/sprunge/sprunge.plugin.zsh @@ -11,7 +11,7 @@ # 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 +# 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 @@ -21,9 +21,9 @@ # Original found at http://www.shellperson.net/sprunge-pastebin-script/ sprunge () { - if [ -t 0 ]; then - if [ "$*" ]; then - if [ -f "$*" ]; then + if [[ -t 0 ]]; then + if [[ "$*" ]]; then + if [[ -f "$*" ]]; then # Use python to attempt to detect the syntax syntax=$(echo "try: from pygments.lexers import get_lexer_for_filename @@ -81,7 +81,7 @@ HERE done | curl -F 'sprunge=<-' http://sprunge.us) fi - if [ "$syntax" != "text" ]; then + if [[ "$syntax" != "text" ]]; then echo "$url?$syntax" else echo $url