From 60ab3d26e5d5d8d82148b8727365e238f41e810b Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 31 May 2024 10:10:00 +1000 Subject: [PATCH] CI: Remove shebang from non-executable scripts Some of our CI shell scripts are meant only to be sourced and not run directly however they include an initial shebang line, implying that they should be run. Remove the shebang line from `crates.sh` and the various `test_vars.sh` scripts. Add a `shellcheck` directive to inhibit the no-shebang warning. Fix: #2764 --- base58/contrib/test_vars.sh | 4 +++- bitcoin/contrib/test_vars.sh | 4 +++- contrib/crates.sh | 4 +++- contrib/test_vars.sh | 4 +++- hashes/contrib/test_vars.sh | 4 +++- internals/contrib/test_vars.sh | 4 +++- io/contrib/test_vars.sh | 4 +++- units/contrib/test_vars.sh | 4 +++- 8 files changed, 24 insertions(+), 8 deletions(-) mode change 100755 => 100644 contrib/crates.sh diff --git a/base58/contrib/test_vars.sh b/base58/contrib/test_vars.sh index c456fe0d3..88e2d26e1 100644 --- a/base58/contrib/test_vars.sh +++ b/base58/contrib/test_vars.sh @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +# No shebang, this file should not be executed. +# shellcheck disable=SC2148 +# # disable verify unused vars, despite the fact that they are used when sourced # shellcheck disable=SC2034 diff --git a/bitcoin/contrib/test_vars.sh b/bitcoin/contrib/test_vars.sh index cab77a509..7dbdf4076 100644 --- a/bitcoin/contrib/test_vars.sh +++ b/bitcoin/contrib/test_vars.sh @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +# No shebang, this file should not be executed. +# shellcheck disable=SC2148 +# # disable verify unused vars, despite the fact that they are used when sourced # shellcheck disable=SC2034 diff --git a/contrib/crates.sh b/contrib/crates.sh old mode 100755 new mode 100644 index f74787e47..5a6dd7645 --- a/contrib/crates.sh +++ b/contrib/crates.sh @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +# No shebang, this file should not be executed. +# shellcheck disable=SC2148 +# # disable verify unused vars, despite the fact that they are used when sourced # shellcheck disable=SC2034 diff --git a/contrib/test_vars.sh b/contrib/test_vars.sh index c490c3678..3943aac65 100644 --- a/contrib/test_vars.sh +++ b/contrib/test_vars.sh @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +# No shebang, this file should not be executed. +# shellcheck disable=SC2148 +# # # Used by labeler.yaml # diff --git a/hashes/contrib/test_vars.sh b/hashes/contrib/test_vars.sh index 4020401c5..b74aed8e6 100644 --- a/hashes/contrib/test_vars.sh +++ b/hashes/contrib/test_vars.sh @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +# No shebang, this file should not be executed. +# shellcheck disable=SC2148 +# # disable verify unused vars, despite the fact that they are used when sourced # shellcheck disable=SC2034 diff --git a/internals/contrib/test_vars.sh b/internals/contrib/test_vars.sh index c17317757..ad0a3f27e 100644 --- a/internals/contrib/test_vars.sh +++ b/internals/contrib/test_vars.sh @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +# No shebang, this file should not be executed. +# shellcheck disable=SC2148 +# # disable verify unused vars, despite the fact that they are used when sourced # shellcheck disable=SC2034 diff --git a/io/contrib/test_vars.sh b/io/contrib/test_vars.sh index df392afac..92dc09406 100644 --- a/io/contrib/test_vars.sh +++ b/io/contrib/test_vars.sh @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +# No shebang, this file should not be executed. +# shellcheck disable=SC2148 +# # disable verify unused vars, despite the fact that they are used when sourced # shellcheck disable=SC2034 diff --git a/units/contrib/test_vars.sh b/units/contrib/test_vars.sh index c17317757..ad0a3f27e 100644 --- a/units/contrib/test_vars.sh +++ b/units/contrib/test_vars.sh @@ -1,4 +1,6 @@ -#!/usr/bin/env bash +# No shebang, this file should not be executed. +# shellcheck disable=SC2148 +# # disable verify unused vars, despite the fact that they are used when sourced # shellcheck disable=SC2034