summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChloe Kudryavtsev <toast@toastin.space>2019-03-27 20:43:01 -0400
committerChloe Kudryavtsev <toast@toastin.space>2019-03-27 20:43:01 -0400
commit81f656b5c119a8658d4a762f537f23af42e7c7cb (patch)
treec7019c5547ba88309ea0b41e3785c4c7d72ea848
parent[client] Update shell script/sourceable (diff)
[client] new shell script
Also sourceable, but not autoload-able See toasty-zsh for an autoloadable version
-rwxr-xr-xclient/brpaste10
1 files changed, 10 insertions, 0 deletions
diff --git a/client/brpaste b/client/brpaste
new file mode 100755
index 0000000..0e3dbce
--- /dev/null
+++ b/client/brpaste
@@ -0,0 +1,10 @@
+#!/bin/sh
+brpaste() {
+ host='https://brpaste.xyz'
+ [ $# -eq 0 ] && set -- '-'
+ brpaste_id=$(curl -#fF "data=<$1" "$host") \
+ || { echo 'ERROR: Upload failed!' >&2 && exit 1; }
+ printf '%s/%s\n' "$host" "$brpaste_id"
+}
+
+return 0 2>/dev/null || brpaste "$@"