From 0f5b844164ed9cf152f9a5fb517222993ecbce95 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 26 Aug 2026 18:25:23 +0100 Subject: [PATCH] =?UTF-8?q?fix(shell):=20two=20parse=20errors=20=E2=80=94?= =?UTF-8?q?=20missing=20';'=20before=20'}',=20and=20shell=20logic=20inside?= =?UTF-8?q?=20an=20array=20literal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two files, two distinct parse failures. nick-shells/shell/modules/prompt.sh:30 — 'precmd() { PS1="..." }' needs a ';' before the closing brace; without it the whole file fails to parse. nerdsafe-restart/run-constrained.sh:163 — '${HOME}/.asdf && --volume=...' sat INSIDE the NERDCTL_ARGS=( ... ) array literal. Conditional logic is not valid there, so the array never closed and the file did not parse — meaning the container was never receiving any of these arguments. Moved out to a conditional append after the array closes, which is what the comment intended. Note prompt.sh still reports SC2148 (no shebang). It is a sourced module, so a shebang may be inappropriate; left for separate triage rather than added blindly. Found by an estate-wide shellcheck sweep of 5,111 tracked scripts across 375 repos: 11 files fail to PARSE (SC1073/SC1072). shellcheck stops analysing at the failure, so everything after it in the file was never checked either. Verified: shellcheck -S error reports 0 parse errors for the file(s) touched. --- nerdsafe-restart/run-constrained.sh | 5 +++-- nick-shells/shell/modules/prompt.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/nerdsafe-restart/run-constrained.sh b/nerdsafe-restart/run-constrained.sh index c0468c21..49e4ae74 100644 --- a/nerdsafe-restart/run-constrained.sh +++ b/nerdsafe-restart/run-constrained.sh @@ -159,8 +159,6 @@ NERDCTL_ARGS=( --volume="${HOME}/.config:${HOME}/.config:ro" --volume="${HOME}/.local:${HOME}/.local:ro" - # Mount asdf if present - ${HOME}/.asdf && --volume="${HOME}/.asdf:${HOME}/.asdf:ro" # Environment --env="HOME=${HOME}" @@ -175,6 +173,9 @@ NERDCTL_ARGS=( "$IMAGE_NAME" ) +# Mount asdf only if present (cannot be expressed inside the array literal above) +[ -d "${HOME}/.asdf" ] && NERDCTL_ARGS+=( --volume="${HOME}/.asdf:${HOME}/.asdf:ro" ) + # Add asdf mount if directory exists if [[ -d "${HOME}/.asdf" ]]; then NERDCTL_ARGS=( diff --git a/nick-shells/shell/modules/prompt.sh b/nick-shells/shell/modules/prompt.sh index 3f496f08..63b50902 100644 --- a/nick-shells/shell/modules/prompt.sh +++ b/nick-shells/shell/modules/prompt.sh @@ -27,7 +27,7 @@ case $- in if [ -n "${BASH_VERSION:-}" ]; then PROMPT_COMMAND='PS1="$(__ns_prompt)"' elif [ -n "${ZSH_VERSION:-}" ]; then - precmd() { PS1="$(__ns_prompt)" } + precmd() { PS1="$(__ns_prompt)"; } else PS1='$ ' fi