This commit is contained in:
Gabriel Kaam 2017-05-03 17:23:16 +00:00 committed by GitHub
commit aa7e69aa0d
2 changed files with 31 additions and 0 deletions

View file

@ -0,0 +1,6 @@
# Transfer.sh
[Transfer.sh](https://transfer.sh/) plugin - easy file sharing from the command line
## Usage
Just type `transfer hello.txt` and let the magic happen

View file

@ -0,0 +1,25 @@
# From https://transfer.sh/
# Modified by Gabriel Kaam <gabriel@kaam.fr>
function transfer() {
if [[ $# -eq 0 ]]; then
cat<<EOF
No arguments specified. Usage:
transfer /tmp/test.md
cat /tmp/test.md | transfer test.md
EOF
return 1
fi
basefile=$(omz_urlencode "${1:t}")
if tty -s; then
url=$(curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile")
else
url=$(curl --progress-bar --upload-file "-" "https://transfer.sh/$basefile")
fi
echo $url
}
alias transfer=transfer