if ESC from fzf and no deck chosen, then exit
This commit is contained in:
parent
4e49db61b2
commit
9748307404
3
flash
3
flash
|
|
@ -104,6 +104,9 @@ fi
|
||||||
|
|
||||||
# Show pretty FZF preview of decks using BAT
|
# 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')"
|
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(){
|
main(){
|
||||||
IFS=$':'; read -a q <<<$(sort "$DECK" -n --field-separator=: --key=4 | head | shuf -n 1)
|
IFS=$':'; read -a q <<<$(sort "$DECK" -n --field-separator=: --key=4 | head | shuf -n 1)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue