summaryrefslogtreecommitdiff
path: root/functions/brpaste
diff options
context:
space:
mode:
Diffstat (limited to 'functions/brpaste')
-rw-r--r--functions/brpaste6
1 files changed, 6 insertions, 0 deletions
diff --git a/functions/brpaste b/functions/brpaste
new file mode 100644
index 0000000..b4cf5ef
--- /dev/null
+++ b/functions/brpaste
@@ -0,0 +1,6 @@
+#!/bin/zsh
+host='https://brpaste.xyz'
+[[ $# -eq 0 ]] && set -- '-'
+brpaste_id=$(curl -\#fF "data=<$1" "$host") \
+ || { echo 'ERROR: Upload failed!' >&2 && return 1; }
+printf '%s/%s\n' "$host" "$brpaste_id"