From 1eb634bf98a44c462498f78b4270c46a9cfe5071 Mon Sep 17 00:00:00 2001 From: Chloe Kudryavtsev Date: Tue, 20 Aug 2019 17:49:04 -0400 Subject: Move function definition to zsh style Also fix it "exit"ing when autoloaded. --- client/brpaste | 10 ---------- client/brpaste.zsh | 6 ++++++ 2 files changed, 6 insertions(+), 10 deletions(-) delete mode 100755 client/brpaste create mode 100755 client/brpaste.zsh diff --git a/client/brpaste b/client/brpaste deleted file mode 100755 index 0e3dbce..0000000 --- a/client/brpaste +++ /dev/null @@ -1,10 +0,0 @@ -#!/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 "$@" diff --git a/client/brpaste.zsh b/client/brpaste.zsh new file mode 100755 index 0000000..b4cf5ef --- /dev/null +++ b/client/brpaste.zsh @@ -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" -- cgit v1.2.3