Use a local variable for sendfile

This commit is contained in:
Tom Willemse 2014-04-27 01:59:38 +02:00
parent 26e5381fc4
commit 424a165de5

4
hypo
View file

@ -38,14 +38,14 @@ function help_send
function cmd_send function cmd_send
{ {
local sendfile="$1"
if [[ ! -t 0 ]]; then if [[ ! -t 0 ]]; then
sendfile="$(mktemp --suffix ${1-.txt})" sendfile="$(mktemp --suffix ${1-.txt})"
cat - > "$sendfile" cat - > "$sendfile"
elif [[ -z "$1" ]]; then elif [[ -z "$1" ]]; then
cmd_help "send" cmd_help "send"
exit 1 exit 1
else
sendfile="$1"
fi fi
curl --upload-file "$sendfile" "$URL/" curl --upload-file "$sendfile" "$URL/"