Skip to content

Commit

Permalink
Fixed MAX was unset at PARSE
Browse files Browse the repository at this point in the history
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
  • Loading branch information
xezo360hye authored May 25, 2022
1 parent e16e844 commit b80d799
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions conics
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}


Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b80d799

Please sign in to comment.