Skip to content

Commit

Permalink
Better "truthy" detection (take #2)
Browse files Browse the repository at this point in the history
We are running everything with strict -u and that makes false (bool)
values to fail when being evaluated by -eq. We need to ensure that
we only do integer operations on integer strings.
  • Loading branch information
stronk7 committed Feb 22, 2024
1 parent cb03725 commit d1728a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion runner/main/modules/docker-selenium/docker-selenium.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ function docker-selenium_setup() {
# TODO: Remove this once we can start using upstream images (selenium 4 or later).
chromeimage="moodlehq/selenium-standalone-chrome:96.0-moodlehq"

if [[ -n ${USE_SELVERSION} ]] && { [[ ${USE_SELVERSION,,} == "true" ]] || [[ ${USE_SELVERSION} -gt 0 ]]; }; then
if [[ -n ${USE_SELVERSION} ]] && {
[[ ${USE_SELVERSION,,} == "true" ]] || {
[[ ${USE_SELVERSION} =~ ^[0-9]+$ ]] && [[ ${USE_SELVERSION} -gt 0 ]]; }; }; then
chromeimage="selenium/standalone-chrome:${SELVERSION}"
fi

Expand Down

0 comments on commit d1728a5

Please sign in to comment.