From 352d2fa73dda9ad24f70c7c316289c868db62ac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Tue, 20 Dec 2022 12:10:10 +0100 Subject: [PATCH] scripts: follow shfmt --- scripts/check-third-party.sh | 6 +++--- scripts/crlf-test.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/check-third-party.sh b/scripts/check-third-party.sh index 54b4550..2fad083 100755 --- a/scripts/check-third-party.sh +++ b/scripts/check-third-party.sh @@ -36,7 +36,7 @@ modules=( # TODO: consider github.com/mattn/go-sqlite3 to cover a DB and more cgo ) -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) exit_code=0 @@ -49,9 +49,9 @@ BASE_GOFLAGS="$(go env GOFLAGS)" CACHED_MODFILES="${SCRIPT_DIR}/cached_modfiles" mkdir -p "${CACHED_MODFILES}" -for (( i=0; i<${#modules[@]}; i+=2 )); do +for ((i = 0; i < ${#modules[@]}; i += 2)); do module="${modules[i]}" - version="${modules[i+1]}" + version="${modules[i + 1]}" { # Initialize an empty module, so we can run "go build", diff --git a/scripts/crlf-test.sh b/scripts/crlf-test.sh index 315abf2..56e9e95 100755 --- a/scripts/crlf-test.sh +++ b/scripts/crlf-test.sh @@ -1,6 +1,6 @@ #!/bin/bash -if \ +if grep \ --recursive \ --files-with-matches \ @@ -9,8 +9,8 @@ if \ --max-count=1 \ --exclude-dir="\.git" \ $'\r' \ - . \ - ; then + . +then # TODO exit status should be number of files with wrong endings found echo -e "Found at least a file with CRLF endings." exit 1