From 37f0638bd89a4f9b7d9f96f9b68bb8182671a240 Mon Sep 17 00:00:00 2001
From: Teake Nutma <t.a.nutma@rug.nl>
Date: Thu, 9 Jun 2022 10:42:29 +0200
Subject: [PATCH] Use xargs

---
 .gitlab-ci.yml | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f45e999..5180c6f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -22,12 +22,10 @@ build_containers:
   script:
     # Find the directories that contain a file named 'Dockerfile'
     - |
-      set -x
-      set -e
       find . -name Dockerfile -type f | while read FILE;
       do
           # Strip leading './' and trailing '/<filename>'
-          DOCKER_DIR=$(echo "${FILE}" | sed -r 's|^\./||' | dirname)
+          DOCKER_DIR=$(echo "${FILE}" | sed -r 's|^\./||' | xargs dirname)
           if grep -q "^${DOCKER_DIR}" changed_files.log;
           then
               echo "Detected a changed file inside ./${DOCKER_DIR}/. (Re)build the container."
-- 
GitLab