From: Elias Rohrer Date: Thu, 25 Apr 2024 13:32:32 +0000 (+0200) Subject: Fix misc `shellcheck` complaints X-Git-Tag: v0.0.124-beta~15^2~2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=e5fea785024408a0ea0ce283dc2186be43985518;p=rust-lightning Fix misc `shellcheck` complaints --- diff --git a/ci/check-compiles.sh b/ci/check-compiles.sh index 2fe62be78..7ad9f4df1 100755 --- a/ci/check-compiles.sh +++ b/ci/check-compiles.sh @@ -1,7 +1,7 @@ #!/bin/sh set -e set -x -echo Testing $(git log -1 --oneline) +echo "Testing $(git log -1 --oneline)" cargo check cargo doc cargo doc --document-private-items diff --git a/ci/check-each-commit.sh b/ci/check-each-commit.sh index e4723c837..42e3d0e76 100755 --- a/ci/check-each-commit.sh +++ b/ci/check-each-commit.sh @@ -12,4 +12,4 @@ if [ "$(git log --pretty="%H %D" | grep "^[0-9a-f]*.* $1")" = "" ]; then echo "It seems like the current checked-out commit is not based on $1" exit 1 fi -git rebase --exec ci/check-compiles.sh $1 +git rebase --exec ci/check-compiles.sh "$1" diff --git a/ci/rustfmt.sh b/ci/rustfmt.sh index 56384aae3..1a9053a28 100755 --- a/ci/rustfmt.sh +++ b/ci/rustfmt.sh @@ -14,8 +14,8 @@ VERS="" # Run fmt TMP_FILE=$(mktemp) -find . -name '*.rs' -type f |sort >$TMP_FILE -for file in $(comm -23 $TMP_FILE rustfmt_excluded_files); do +find . -name '*.rs' -type f |sort >"$TMP_FILE" +for file in $(comm -23 "$TMP_FILE" rustfmt_excluded_files); do echo "Checking formatting of $file" - rustfmt $VERS --edition 2021 --check $file + rustfmt $VERS --edition 2021 --check "$file" done diff --git a/contrib/download_bitcoind_electrs.sh b/contrib/download_bitcoind_electrs.sh index 031323300..8b938a563 100755 --- a/contrib/download_bitcoind_electrs.sh +++ b/contrib/download_bitcoind_electrs.sh @@ -22,7 +22,8 @@ elif [[ "$HOST_PLATFORM" == *darwin* ]]; then BITCOIND_DL_FILE_NAME=bitcoin-"$BITCOIND_VERSION"-x86_64-apple-darwin.tar.gz BITCOIND_DL_HASH="1acfde0ec3128381b83e3e5f54d1c7907871d324549129592144dd12a821eff1" else - echo "\n\nUnsupported platform: $HOST_PLATFORM Exiting.." + printf "\n\n" + echo "Unsupported platform: $HOST_PLATFORM Exiting.." exit 1 fi diff --git a/contrib/run-rustfmt.sh b/contrib/run-rustfmt.sh index 823e9e025..ffce4242f 100755 --- a/contrib/run-rustfmt.sh +++ b/contrib/run-rustfmt.sh @@ -14,8 +14,8 @@ VERS="" # Run fmt TMP_FILE=$(mktemp) -find . -name '*.rs' -type f |sort >$TMP_FILE -for file in $(comm -23 $TMP_FILE rustfmt_excluded_files); do +find . -name '*.rs' -type f |sort >"$TMP_FILE" +for file in $(comm -23 "$TMP_FILE" rustfmt_excluded_files); do echo "Formatting $file..." - rustfmt $VERS --edition 2021 $file + rustfmt $VERS --edition 2021 "$file" done