Skip to content

Commit

Permalink
Improve identifying min gaarf version need for ARP
Browse files Browse the repository at this point in the history
Change-Id: I8224c85ca30a90a3492aab8eba100ed9b8b92ea1
  • Loading branch information
AVMarkin committed Nov 29, 2023
1 parent 1dda874 commit 9c3defc
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions app/scripts/shell_utils/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ prompt_running() {
fi
}

parse_yaml () {
parse_yaml() {
local yaml_file="$1"
local prefix="$2"
while read line; do
Expand All @@ -118,17 +118,26 @@ check_gaarf_version() {
minor_version="${version_array[1]}"
patch_version="${version_array[2]}"

if [[ $major_version -ge 1 && $minor_version -ge 11 && $patch_version -ge 5 ]]; then
echo "google-ads-api-report-fetcher is up-to-date"
else
echo "You are using an old version of google-ads-api-report-fetcher library"
echo "Please update it by running the following command:"
echo -e "${COLOR}pip install -U google-ads-api-report-fetcher${NC}"
exit 1
if [[ $major_version -lt 1 ]]; then
require_newer_gaarf
fi
if [[ $minor_version -lt 11 ]]; then
require_newer_gaarf
fi
if [[ $minor_version -eq 11 && $patch_version < 5 ]]; then
require_newer_gaarf
fi
echo "google-ads-api-report-fetcher is up-to-date"
fi
}

require_newer_gaarf() {
echo "You are using an old version of google-ads-api-report-fetcher library"
echo "Please update it by running the following command:"
echo -e "${COLOR}pip install -U google-ads-api-report-fetcher${NC}"
exit 1
}

infer_answer_from_config() {
config=$1
section=$2
Expand Down

0 comments on commit 9c3defc

Please sign in to comment.