Script with (successful) "until" loop fails with exit code 1

Running a script step @ 1.1.6 fails with exit code 1 after executing the “let a=$?” line, before executing the last line.

a=1
until [ $a -eq 0 ]; do
  timeout 300 bash -c "flutter pub get"
  let a=$?
done

flutter packages pub run build_runner build

Never mind. I realized that “let” exits with a 1 if the following statement evaluates to 0. So I surrounded it by “set +e” and “set -e” to ignore the non-zero exit code of the command.

Hope this helps someone in the future.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.