From: Andrei Pavel Date: Mon, 1 Feb 2021 13:14:16 +0000 (+0200) Subject: [#1692] Gitlab CI: fix "test: too many arguments" X-Git-Tag: Kea-1.9.10~121 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=918479fc2c27c4c71ea46e2353e6c1dda69e071b;p=thirdparty%2Fkea.git [#1692] Gitlab CI: fix "test: too many arguments" --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a7359ccbaa..6092b176d1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/tools/print-generated-files.sh b/tools/print-generated-files.sh index db85126836..ce219c3029 100755 --- a/tools/print-generated-files.sh +++ b/tools/print-generated-files.sh @@ -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