Fail on invalid selection

This commit is contained in:
ItsDrike 2021-12-24 04:52:38 +01:00
parent 1c73a80dfc
commit 0d0e9031d0
No known key found for this signature in database
GPG key ID: FB8CA11A2CF3A843

View file

@ -11,6 +11,10 @@ if [ -n "$1" ]; then
fi
else
selected=$(printf "$SELECTABLE" | fzf)
if [ $? -ne 0 ]; then
echo "Invalid selection: '$selected'"
exit 1
fi
selected=$(printf "$selected" | tail -1)
fi