diff --git a/plugins/transfer/transfer.plugin.zsh b/plugins/transfer/transfer.plugin.zsh index 664d9a735..ab409c334 100644 --- a/plugins/transfer/transfer.plugin.zsh +++ b/plugins/transfer/transfer.plugin.zsh @@ -1,20 +1,25 @@ +# From https://transfer.sh/ +# Modified by Gabriel Kaam + function transfer() { - if [ $# -eq 0 ]; then - echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md" + if [[ $# -eq 0 ]]; then + cat<> $tmpfile + url=$(curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile") else - curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile + url=$(curl --progress-bar --upload-file "-" "https://transfer.sh/$basefile") fi - cat $tmpfile - rm -f $tmpfile + echo $url } alias transfer=transfer -