]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1692] Gitlab CI: fix "test: too many arguments"
authorAndrei Pavel <andrei@isc.org>
Mon, 1 Feb 2021 13:14:16 +0000 (15:14 +0200)
committerAndrei Pavel <andrei@isc.org>
Thu, 1 Jul 2021 18:37:47 +0000 (21:37 +0300)
.gitlab-ci.yml
tools/print-generated-files.sh

index a7359ccbaa1d9809d01b17d02a7a49cc254fd145..6092b176d1e7d016513c940e63c886c8ed88b467 100644 (file)
@@ -142,6 +142,8 @@ missing-git-attribute:
     - linux
     - amd64
   script:
-    - test -z $(git diff)
+    - git_diff=$(git diff)
+    - if test -n "${git_diff}"; then printf '%s\n\ngit diff should be empty here under all circumstances. CI broken?\n' "${git_diff}"; exit 1; fi
     - ./tools/print-generated-files.sh -a
-    - test -z $(git diff)
+    - git_diff=$(git diff)
+    - if test -n "${git_diff}"; then printf '%s\n\n.gitattributes are missing a generated file. Please run "./tools/print-generated-files.sh -a" and commit the resulting change to fix them.\n' "${git_diff}"; exit 1; fi
index db85126836f15ec3a1623cf2ab2f6a4d47dc79b8..ce219c302953afb2cf9006aaadedbf0ce446dda4 100755 (executable)
@@ -56,10 +56,10 @@ fi
 # Parse parameters.
 while test ${#} -gt 0; do
   case "${1}" in
-    # [-d|--debug]             enable debug mode, showing every executed command
+    # [-d|--debug]                 enable debug mode, showing every executed command
     '-d'|'--debug') set -vx ;;
 
-    # [-h|--help]              print usage (this text).
+    # [-h|--help]                  print usage (this text)
     '-h'|'--help') print_usage ;;
 
     # [-a|--amend]                 amend .gitattributes