From 2baddc6b048acf1c9b7198e90f9061a5e4890723 Mon Sep 17 00:00:00 2001 From: Mitch Weaver Date: Wed, 13 May 2020 00:57:40 -0500 Subject: [PATCH] fix ordering of no-links error message --- subs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/subs b/subs index 929129c..14acb40 100755 --- a/subs +++ b/subs @@ -141,8 +141,6 @@ update_subs() { # Grab current cache of subscriptions, sort by date uploaded # -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* cat_subs() { - [ -d "$SUBS_CACHE" ] || die 'Subs cache has not been retrieved.' - sort -r "$SUBS_CACHE"/* | \ while read -r line ; do chan=${line#*$SEP} @@ -159,7 +157,11 @@ cat_subs() { # Split the concatenated lines into entities, send to menu program. # Finally, play the result with mpv. get_sel() { - sel=$(cat_subs | $SUBS_MENU_PROG) + if [ -d "$SUBS_CACHE" ] ; then + sel=$(cat_subs | $SUBS_MENU_PROG) + else + die 'Subs cache has not been retrieved.' + fi [ "$sel" ] || die Interrupted