From 424a165de583145656919a40c043f8ae399253ea Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sun, 27 Apr 2014 01:59:38 +0200 Subject: [PATCH] Use a local variable for sendfile --- hypo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hypo b/hypo index 14df732..40a9e43 100755 --- a/hypo +++ b/hypo @@ -38,14 +38,14 @@ function help_send function cmd_send { + local sendfile="$1" + if [[ ! -t 0 ]]; then sendfile="$(mktemp --suffix ${1-.txt})" cat - > "$sendfile" elif [[ -z "$1" ]]; then cmd_help "send" exit 1 - else - sendfile="$1" fi curl --upload-file "$sendfile" "$URL/"