From 9748307404b34616126aa67e32ef8050a7c55ea4 Mon Sep 17 00:00:00 2001 From: Bryan Jenks Date: Mon, 20 Apr 2020 16:41:38 -0700 Subject: [PATCH] if ESC from fzf and no deck chosen, then exit --- flash | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flash b/flash index 5fb68d9..4bec068 100755 --- a/flash +++ b/flash @@ -104,6 +104,9 @@ fi # Show pretty FZF preview of decks using BAT DECK="$(find -maxdepth 999 -iname "*.csv" | fzf --preview='bat --theme="Solarized (dark)" --style=numbers --color=always {} | head -500')" +if [ -z $DECK ]; then # If Variable String Length is 0 + exit +fi main(){ IFS=$':'; read -a q <<<$(sort "$DECK" -n --field-separator=: --key=4 | head | shuf -n 1)