From b80d7997e3355a61ee259d51d9d4aafe24b16e72 Mon Sep 17 00:00:00 2001 From: xezo360hye <79970533+xezo360hye@users.noreply.github.com> Date: Wed, 25 May 2022 21:48:26 +0300 Subject: [PATCH] Fixed MAX was unset at PARSE When using `-c`/`--count` it tried to verify that number is not too big but MAX variable wasn't set yet. Now it's set in conics::defaults --- conics | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conics b/conics index f76d2ef..fa3f9a2 100755 --- a/conics +++ b/conics @@ -10,6 +10,9 @@ conics::defaults() { REMOVE=false # Remove images after closing FBI (true/false) VERBOSE=false # Verbose output (true/false) VIEWER="fbi" # Image viewer to use (fbi/fim) + + # Get count of images available + MAX=$(curl -s https://xkcd.com/info.0.json | jq -r '.num') } @@ -162,9 +165,6 @@ conics::download() { conics::watch() { - # Get count of images available - local MAX=$(curl -s https://xkcd.com/info.0.json | jq -r '.num') - # In case of error (e.g. no internet connection) local status="${PIPESTATUS[0]}" if [[ "$status" != 0 ]]; then