]> Sergey Matveev's repositories - nnn.git/commitdiff
.cbcp plugin: output a more useful error message
authorPatrick <patrickf3139@gmail.com>
Fri, 29 Apr 2022 22:50:47 +0000 (15:50 -0700)
committerArun Prakash Jana <engineerarun@gmail.com>
Sat, 30 Apr 2022 09:14:11 +0000 (14:44 +0530)
plugins/.cbcp

index 3a71927e5a7ffc059184d39343e6386a6d5ff916..70f9b75c15d11533f983424f6d944b1b0802649f 100755 (executable)
@@ -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