From 4ddd048febef9e9098c8f5a19837a38c776b538b Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 29 Apr 2022 15:50:47 -0700 Subject: [PATCH] .cbcp plugin: output a more useful error message --- plugins/.cbcp | 1 + 1 file changed, 1 insertion(+) 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