From c34e5b6c3551c6429573cbd4223d4ffd0bb4d7c3 Mon Sep 17 00:00:00 2001
From: Christophe Chaudier <devops@cchaudier.fr>
Date: Tue, 4 Dec 2018 11:12:49 +0100
Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(ci)=20xargs=20is=20not=20needed=20?=
 =?UTF-8?q?in=20begin=20of=20line?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 gci-templates/job/bash-lint.yml | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/gci-templates/job/bash-lint.yml b/gci-templates/job/bash-lint.yml
index bdc0e50..63e23ab 100644
--- a/gci-templates/job/bash-lint.yml
+++ b/gci-templates/job/bash-lint.yml
@@ -4,18 +4,17 @@ bash-lint:
   variables:
     files_to_lint: ""
   script: |
-    cd $working_directory
-    for script in $(find . -name "*.sh"); do
-      echo "----> lint script $script"
-      xargs docker run --rm \
+    _shellcheck () {
+      echo "----> lint script $1"
+      docker run --rm \
         -v "$(pwd):/mnt/" \
         -v "/tmp:/tmp_ro":ro \
-        koalaman/shellcheck $script
+        koalaman/shellcheck $1
+    }
+    cd $working_directory
+    for script in $(find . -name "*.sh"); do
+      _shellcheck $script
     done
     for script in $files_to_lint; do
-      echo "----> lint script $script"
-      xargs docker run --rm \
-        -v "$(pwd):/mnt/" \
-        -v "/tmp:/tmp_ro":ro \
-        koalaman/shellcheck $script
+      _shellcheck $script
     done
\ No newline at end of file
-- 
GitLab