From a98a1bf84664add5a3b863d2ac8b344c54a48ce7 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 26 Aug 2026 18:40:13 +0100 Subject: [PATCH] =?UTF-8?q?fix(shell):=20declare=20the=20shell=20=E2=80=94?= =?UTF-8?q?=20shebang=20where=20executed,=20directive=20where=20sourced?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit shellcheck SC2148 ('target shell is unknown') on 13 files here. Deliberately NOT a blanket shebang. The files split by how they are USED: * 0 executed (have +x, never source'd) -> added '#!/usr/bin/env bash' * 13 sourced (referenced by source/.) -> added '# shellcheck shell=bash' A source'd file is never run as its own process, so a shebang there is misleading — it claims an execution model the file does not have. The shellcheck directive states the dialect without making that false claim. Found by an estate-wide sweep of 5,111 tracked scripts across 375 repos: 85 files lack a shell declaration. 40 of those were left alone deliberately — they are vendored duplicates (7 identical copies of one recoverer.sh) or a nested kith/ tree, and 37 of the 40 are never invoked by name anywhere, so editing them would be churn in vendored code. Remaining SC2148 in this repo after the change: 0 --- nick-shells/shell/baseline.sh | 1 + nick-shells/shell/examples/developer.sh | 1 + nick-shells/shell/examples/interactive.sh | 1 + nick-shells/shell/examples/minimal.sh | 1 + nick-shells/shell/modules/aliases.sh | 1 + nick-shells/shell/modules/behavior.sh | 1 + nick-shells/shell/modules/dev.sh | 1 + nick-shells/shell/modules/editor.sh | 1 + nick-shells/shell/modules/history.sh | 1 + nick-shells/shell/modules/locale.sh | 1 + nick-shells/shell/modules/path.sh | 1 + nick-shells/shell/modules/security.sh | 1 + nick-shells/shell/modules/xdg.sh | 1 + 13 files changed, 13 insertions(+) diff --git a/nick-shells/shell/baseline.sh b/nick-shells/shell/baseline.sh index 40f29fbb..cb422366 100644 --- a/nick-shells/shell/baseline.sh +++ b/nick-shells/shell/baseline.sh @@ -1,3 +1,4 @@ +# shellcheck shell=bash # SPDX-License-Identifier: MPL-2.0 OR MPL-2.0 # SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell # diff --git a/nick-shells/shell/examples/developer.sh b/nick-shells/shell/examples/developer.sh index 72b497ec..cd7987f2 100644 --- a/nick-shells/shell/examples/developer.sh +++ b/nick-shells/shell/examples/developer.sh @@ -1,3 +1,4 @@ +# shellcheck shell=bash # SPDX-License-Identifier: MPL-2.0 OR MPL-2.0 # SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell # diff --git a/nick-shells/shell/examples/interactive.sh b/nick-shells/shell/examples/interactive.sh index 47d9ec9a..418dee60 100644 --- a/nick-shells/shell/examples/interactive.sh +++ b/nick-shells/shell/examples/interactive.sh @@ -1,3 +1,4 @@ +# shellcheck shell=bash # SPDX-License-Identifier: MPL-2.0 OR MPL-2.0 # SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell # diff --git a/nick-shells/shell/examples/minimal.sh b/nick-shells/shell/examples/minimal.sh index 3fb3f02b..f05f1f53 100644 --- a/nick-shells/shell/examples/minimal.sh +++ b/nick-shells/shell/examples/minimal.sh @@ -1,3 +1,4 @@ +# shellcheck shell=bash # SPDX-License-Identifier: MPL-2.0 OR MPL-2.0 # SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell # diff --git a/nick-shells/shell/modules/aliases.sh b/nick-shells/shell/modules/aliases.sh index 05cce606..c699e559 100644 --- a/nick-shells/shell/modules/aliases.sh +++ b/nick-shells/shell/modules/aliases.sh @@ -1,3 +1,4 @@ +# shellcheck shell=bash # SPDX-License-Identifier: MPL-2.0 OR MPL-2.0 # SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell # diff --git a/nick-shells/shell/modules/behavior.sh b/nick-shells/shell/modules/behavior.sh index 4e472eb6..5b4cfaec 100644 --- a/nick-shells/shell/modules/behavior.sh +++ b/nick-shells/shell/modules/behavior.sh @@ -1,3 +1,4 @@ +# shellcheck shell=bash # SPDX-License-Identifier: MPL-2.0 OR MPL-2.0 # SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell # diff --git a/nick-shells/shell/modules/dev.sh b/nick-shells/shell/modules/dev.sh index 1a5a95d7..2391c247 100644 --- a/nick-shells/shell/modules/dev.sh +++ b/nick-shells/shell/modules/dev.sh @@ -1,3 +1,4 @@ +# shellcheck shell=bash # SPDX-License-Identifier: MPL-2.0 OR MPL-2.0 # SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell # diff --git a/nick-shells/shell/modules/editor.sh b/nick-shells/shell/modules/editor.sh index 70c91663..96801599 100644 --- a/nick-shells/shell/modules/editor.sh +++ b/nick-shells/shell/modules/editor.sh @@ -1,3 +1,4 @@ +# shellcheck shell=bash # SPDX-License-Identifier: MPL-2.0 OR MPL-2.0 # SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell # diff --git a/nick-shells/shell/modules/history.sh b/nick-shells/shell/modules/history.sh index dd8a1f57..747a9d2b 100644 --- a/nick-shells/shell/modules/history.sh +++ b/nick-shells/shell/modules/history.sh @@ -1,3 +1,4 @@ +# shellcheck shell=bash # SPDX-License-Identifier: MPL-2.0 OR MPL-2.0 # SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell # diff --git a/nick-shells/shell/modules/locale.sh b/nick-shells/shell/modules/locale.sh index 2d71dbe5..a77f0e18 100644 --- a/nick-shells/shell/modules/locale.sh +++ b/nick-shells/shell/modules/locale.sh @@ -1,3 +1,4 @@ +# shellcheck shell=bash # SPDX-License-Identifier: MPL-2.0 OR MPL-2.0 # SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell # diff --git a/nick-shells/shell/modules/path.sh b/nick-shells/shell/modules/path.sh index 86491c4b..d5666fc9 100644 --- a/nick-shells/shell/modules/path.sh +++ b/nick-shells/shell/modules/path.sh @@ -1,3 +1,4 @@ +# shellcheck shell=bash # SPDX-License-Identifier: MPL-2.0 OR MPL-2.0 # SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell # diff --git a/nick-shells/shell/modules/security.sh b/nick-shells/shell/modules/security.sh index 77dddb6c..a42085d4 100644 --- a/nick-shells/shell/modules/security.sh +++ b/nick-shells/shell/modules/security.sh @@ -1,3 +1,4 @@ +# shellcheck shell=bash # SPDX-License-Identifier: MPL-2.0 OR MPL-2.0 # SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell # diff --git a/nick-shells/shell/modules/xdg.sh b/nick-shells/shell/modules/xdg.sh index 2b115d44..791ced8d 100644 --- a/nick-shells/shell/modules/xdg.sh +++ b/nick-shells/shell/modules/xdg.sh @@ -1,3 +1,4 @@ +# shellcheck shell=bash # SPDX-License-Identifier: MPL-2.0 OR MPL-2.0 # SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell #