Skip to content

Commit

Permalink
rename variable only_relevant_part -> last_page_phrase
Browse files Browse the repository at this point in the history
  • Loading branch information
sagilaufer1992 committed Apr 6, 2022
1 parent c777261 commit 9ab31e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libexec/tgenv-list-remote
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ link_release="https://api.github.com/repos/gruntwork-io/terragrunt/tags?per_page

# the response header (--head) contains a link to the last page, contains the last page number and the "last" keyword to help identify
page_curl=$(curl -s --tlsv1.2 --head "$link_release")
only_relevant_part=$(echo "$page_curl" | grep -o -E "&page=[0-9]+>; rel=\"last")
last_page_phrase=$(echo "$page_curl" | grep -o -E "&page=[0-9]+>; rel=\"last")
re="([0-9]+)"
if [[ $only_relevant_part =~ $re ]] ; then
if [[ $last_page_phrase =~ $re ]] ; then
pages=${BASH_REMATCH[0]}
else
pages=4 # default in case something changes in the way the responses are formatted
Expand Down

0 comments on commit 9ab31e5

Please sign in to comment.