Use a local variable for sendfile
This commit is contained in:
parent
26e5381fc4
commit
424a165de5
1 changed files with 2 additions and 2 deletions
4
hypo
4
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/"
|
||||
|
|
Loading…
Reference in a new issue