From 324f74f6726e047b2e292dc8033493294d3556c5 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Wed, 3 Apr 2024 21:33:40 +0100 Subject: [PATCH] Use xargs over find -exec to ensure exit code is returned properly Running this script in it's previous form (via `docker compose run`) always returned an exit code of 0. This is due to `find` always returning a 0 exit code, unless an error occurred while traversing the directories. --- scripts/install_eval_deps.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install_eval_deps.sh b/scripts/install_eval_deps.sh index 716d513c..8fa53169 100644 --- a/scripts/install_eval_deps.sh +++ b/scripts/install_eval_deps.sh @@ -1,5 +1,5 @@ set -euo pipefail export PYTHONUSERBASE=/snekbox/user_base -find /lang/python -mindepth 1 -maxdepth 1 -type d -exec \ - {}/bin/python -m pip install --user -U -r requirements/eval-deps.pip \; +find /lang/python -mindepth 1 -maxdepth 1 -type d -print0 | xargs -0I{} bash -c \ + '{}/bin/python -m pip install --user -U -r requirements/eval-deps.pip' \;