Skip to content

Commit

Permalink
Merge pull request #76 from Nordix/arpest_fix_env_check
Browse files Browse the repository at this point in the history
Fix env-check.sh
  • Loading branch information
denis-tingaikin authored Apr 25, 2024
2 parents 273b4a7 + db972be commit aae7301
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/env-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ mapfile -t readme_envs < <(grep -Eo "${env_prefix}\w+" "${repo}/README.md" | uni
build_cmd "$repo" "$cmd_name"
declare -a cmd_envs
# Since this runs on "ubuntu-runner" I can be sure that no env vars are set and cmd fails
mapfile -t cmd_envs < <( "${repo}/${cmd_name}" 2>&1 | grep -Eo "${env_prefix}\w+" | uniq | sort)

mapfile -t cmd_envs < <( "${repo}/${cmd_name}" 2>&1 | grep -Eo "^${env_prefix}\w+" | uniq | sort)

i=0
j=0
Expand Down Expand Up @@ -75,5 +74,10 @@ for ((;j<${#readme_envs[@]};++j)); do
print_mismatch "${readme_envs[$j]}" "$cmd_name"
done

if [[ "${#readme_envs[@]}" -ne "${#cmd_envs[@]}" ]]; then
fail=1
fi



exit "$fail"

0 comments on commit aae7301

Please sign in to comment.