Add script to upload a file to transfer.sh

This commit is contained in:
Arun Prakash Jana 2019-03-24 17:38:29 +05:30
parent 0328eafcb9
commit f135a30c0c
No known key found for this signature in database
GPG key ID: A75979F35C080412
3 changed files with 18 additions and 1 deletions

View file

@ -13,4 +13,5 @@
| nlaunch | Drop-down independent app launcher (needs fzy), drop in `$PATH`; fallback regular prompt |
| picker | Pick files and pipe the newline-separated list to another utility |
| sxiv | Open images in current directory in sxiv |
| transfer | Upload current file to transfer.sh |
| upgrade | Check and update to latest version of nnn manually on Debian 9 Stretch |

View file

@ -25,7 +25,7 @@ if [ -z "$res" ]; then
read res
fi
if [ -z "$res" ]; then
if ! [ -z "$res" ]; then
if ! [ -z "$minsize" ]; then
imgp -ackx "$res" -s "$minsize"
fi

16
user-scripts/transfer Executable file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env sh
# Description: Upload a file to transfer.sh
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
if ! [ -z "$1" ]; then
# Upload the file, show the download link and wait till user presses any key
curl -s --upload-file "$1" https://transfer.sh/`basename "$1"`
echo
read input
# To write download link to "$1".loc and exit
# curl -s --upload-file "$1" https://transfer.sh/`basename "$1"` -o `basename "$1"`.loc
fi