Commit fa91591f authored by Elouan Martinet's avatar Elouan Martinet

Add ewd script to upload files, to replace pb

Also alias pb to ewd
parent 1b31fb50
......@@ -16,6 +16,7 @@ alias :q=exit
alias ptpb=pb
alias clbin=cb
alias pb=ewd # temporary
if [ -x "$(getpath tree)" ]; then
alias t="tree -a -I '.git|.hg' --noreport -F --dirsfirst"
......
# vim:ft=sh
require curl || exit 1
if [ -z "${EWD_AUTH}" ]; then
echo "EWD_AUTH not set."
exit 1
fi
if [ -t 0 ] && [ -f "$1" ]; then
curl -F f=@"$1" -H "Authorization: ${EWD_AUTH}" https://ewd.xyz/upload.php
elif ! [ -t 0 ]; then
curl -F f=@- -H "Authorization: ${EWD_AUTH}" https://ewd.xyz/upload.php
else
echo "Usage: ewd file"
echo "Usage: <command> 2>&1 | ewd"
exit 1
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment