From: Patrick Date: Fri, 29 Apr 2022 22:50:47 +0000 (-0700) Subject: .cbcp plugin: output a more useful error message X-Git-Tag: v4.6~86 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=4ddd048febef9e9098c8f5a19837a38c776b538b;p=nnn.git .cbcp plugin: output a more useful error message --- diff --git a/plugins/.cbcp b/plugins/.cbcp index 3a71927e..70f9b75c 100755 --- a/plugins/.cbcp +++ b/plugins/.cbcp @@ -22,6 +22,7 @@ IFS="$(printf '%b_' '\n')"; IFS="${IFS%_}" # protect trailing \n selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection} +[ -s "$selection" ] || { echo "plugin .cbcp error: empty selection" >&2 ; exit 1; } if type xsel >/dev/null 2>&1; then # Linux