Skip to content

Commit

Permalink
Use xargs over find -exec to ensure exit code is returned properly
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ChrisLovering authored and MarkKoz committed Apr 7, 2024
1 parent 9cdcd28 commit 316f39e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/install_eval_deps.sh
Original file line number Diff line number Diff line change
@@ -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' \;

0 comments on commit 316f39e

Please sign in to comment.