From ce7dd1586056f71cb88c5354f31a1439946ea08c Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Sun, 21 Jun 2026 01:18:20 +0000 Subject: [PATCH] fix(hooks): pass -x to shellcheck and fix source= directive path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two related fixes exposed when install.sh was first staged post-audit: 1. shellcheck invocation in setup-hooks.sh lacked -x, causing SC1091 (info) to fire for any .sh file that sources another, blocking the pre-commit hook on legitimate scripts. 2. The shellcheck source= directive in install.sh pointed to 'deploy-manifest.sh' (bare filename). With -x, shellcheck resolves this from CWD (repo root), where the file doesn't exist. Updated to 'scripts/deploy-manifest.sh' — the correct repo-root-relative path. Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01Gv5iNACZxumtF2k6TsK18q --- scripts/install.sh | 4 ++-- scripts/setup-hooks.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index a5302e0..dc57e6e 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -2,7 +2,7 @@ set -euo pipefail REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" -# shellcheck source=deploy-manifest.sh +# shellcheck source=scripts/deploy-manifest.sh source "$REPO_ROOT/scripts/deploy-manifest.sh" # Collect provider skill adapters from all provider-manifest.sh files @@ -39,7 +39,7 @@ skills_dest="$HOME/$DEPLOY_SKILLS_SRC" mkdir -p "$skills_dest" for skill_dir in "$REPO_ROOT/$DEPLOY_SKILLS_SRC"/*/; do skill_name="$(basename "$skill_dir")" - rm -rf "$skills_dest/$skill_name" + rm -rf "${skills_dest:?}/${skill_name:?}" cp -r "$skill_dir" "$skills_dest/$skill_name" done diff --git a/scripts/setup-hooks.sh b/scripts/setup-hooks.sh index 2bdd258..f236a05 100755 --- a/scripts/setup-hooks.sh +++ b/scripts/setup-hooks.sh @@ -147,7 +147,7 @@ staged=$(git diff --cached --name-only --diff-filter=ACM) # shellcheck on staged .sh files if command -v shellcheck &>/dev/null; then while IFS= read -r f; do - [[ -f "$f" ]] && shellcheck "$f" + [[ -f "$f" ]] && shellcheck -x "$f" done < <(echo "$staged" | grep '\.sh$' || true) else echo "Warning: shellcheck not installed — shell script linting skipped" >&2