Skip to content

Commit 1a04add

Browse files
committed
fix(uninstall,step-8): shellcheck clean — SC2001, SC2016, step-9→8 renaming
uninstall.sh: - SC2001: replace echo+sed pkg@latest strip with parameter expansion ${pkg//@latest/} - SC2016 (×3): add shellcheck disable comments for intentional sed-regex single-quoted patterns in strip_line calls (these are sed/grep regex patterns, not shell expansions) step-8/step-8-install.sh: - Rename all "Step 9" labels/paths/breadcrumbs to "Step 8" (step was renumbered when step-9 was collapsed; internal references still said Step 9) - SC2001/DL3001: ls glob for NVM claude binary → find with -name/-path (×2 sites) - SC2075: read -p → read -rp on interactive overwrite prompt
1 parent 8c1baad commit 1a04add

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

step-8/step-8-install.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -uo pipefail
33

44
# =============================================================================
5-
# Step 9 — Safety Check — Security Auditing
5+
# Step 8 — Safety Check — Security Auditing
66
# Installs the /safetycheck Claude Code skill for running security audits
77
# Run after Step 1 — requires Claude Code installed
88
# =============================================================================
@@ -100,7 +100,7 @@ verify_prerequisites() {
100100
if command -v claude &>/dev/null; then
101101
success "Claude Code is installed"
102102
else
103-
NVM_CLAUDE=$(ls -1 "$HOME"/.nvm/versions/node/*/bin/claude 2>/dev/null | head -n1)
103+
NVM_CLAUDE=$(find "$HOME/.nvm/versions/node" -name "claude" -path "*/bin/claude" 2>/dev/null | head -n1)
104104
if [ -n "${NVM_CLAUDE:-}" ] && [ -x "$NVM_CLAUDE" ]; then
105105
info "Claude Code found at $NVM_CLAUDE (not on PATH — source ~/.zshrc or open a new shell to use it)"
106106
else
@@ -134,7 +134,7 @@ install_skill() {
134134
# Pinned to a specific commit SHA — prevents rug-pull via mutable branch ref
135135
# To update: change the SHA to the new commit and update SKILL_SHA256 to match
136136
SKILL_COMMIT="7b449b652d946a8eef9aca65f0c8e182b4fb80f7"
137-
SKILL_URL="https://raw.githubusercontent.com/lorecraft-io/cli-maxxing/${SKILL_COMMIT}/step-9/safetycheck-skill/SKILL.md"
137+
SKILL_URL="https://raw.githubusercontent.com/lorecraft-io/cli-maxxing/${SKILL_COMMIT}/step-8/safetycheck-skill/SKILL.md"
138138
SKILL_SHA256="77e1ef1127fa35cd860925a652b96dd062ab080d438787b3bde348176597ab12"
139139

140140
info "Creating skill directory..."
@@ -149,7 +149,7 @@ install_skill() {
149149
else
150150
echo ""
151151
echo -e "${YELLOW}Existing /safetycheck skill found at $SKILL_FILE${NC}"
152-
read -p "Overwrite with latest version? (Y/n): " OVERWRITE
152+
read -rp "Overwrite with latest version? (Y/n): " OVERWRITE
153153
if [[ "$OVERWRITE" =~ ^[Nn]$ ]]; then
154154
info "Keeping existing skill file."
155155
return
@@ -276,7 +276,7 @@ run_self_test() {
276276
success "TEST: Claude Code is available"
277277
TEST_PASS=$((TEST_PASS + 1))
278278
else
279-
NVM_CLAUDE=$(ls -1 "$HOME"/.nvm/versions/node/*/bin/claude 2>/dev/null | head -n1)
279+
NVM_CLAUDE=$(find "$HOME/.nvm/versions/node" -name "claude" -path "*/bin/claude" 2>/dev/null | head -n1)
280280
if [ -n "${NVM_CLAUDE:-}" ] && [ -x "$NVM_CLAUDE" ]; then
281281
info "TEST: Claude Code found at $NVM_CLAUDE (not on PATH — open a new shell to pick it up)"
282282
TEST_PASS=$((TEST_PASS + 1))
@@ -303,7 +303,7 @@ run_self_test() {
303303
print_summary() {
304304
echo ""
305305
echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
306-
echo -e "${GREEN} Step 9 Complete — /safetycheck Installed (20 checks)${NC}"
306+
echo -e "${GREEN} Step 8 Complete — /safetycheck Installed (20 checks)${NC}"
307307
echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
308308
echo ""
309309
echo " Installed:"
@@ -360,7 +360,7 @@ main() {
360360

361361
echo ""
362362
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
363-
echo -e "${BLUE} Step 9 — Safety Check${NC}"
363+
echo -e "${BLUE} Step 8 — Safety Check${NC}"
364364
echo -e "${BLUE} Install the /safetycheck security audit skill${NC}"
365365
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
366366
echo ""
@@ -373,7 +373,7 @@ main() {
373373

374374
# Mark step complete (best-effort — don't fail the run if mkdir/touch can't write)
375375
mkdir -p "$HOME/.cli-maxxing" 2>/dev/null || true
376-
touch "$HOME/.cli-maxxing/step-9.done" 2>/dev/null || true
376+
touch "$HOME/.cli-maxxing/step-8.done" 2>/dev/null || true
377377
}
378378

379379
main "$@"

uninstall.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ uninstall_fidgetflo_stack() {
297297

298298
# Global npm packages
299299
for pkg in fidgetflo@latest agentic-flow@latest @aisuite/chub typescript; do
300-
PKG_NAME=$(echo "$pkg" | sed 's/@latest//')
300+
PKG_NAME="${pkg//@latest/}"
301301
if npm list -g "$PKG_NAME" 2>/dev/null | grep -q "$PKG_NAME"; then
302302
npm uninstall -g "$PKG_NAME" 2>/dev/null || true
303303
success "npm: $PKG_NAME"
@@ -460,6 +460,7 @@ uninstall_step_1() {
460460
# — user's more elaborate PATH lines (with extra paths) are left alone.
461461
if grep -q '# Local bin (ctg' "$rc" 2>/dev/null; then
462462
strip_line '# Local bin (ctg' "$rc"
463+
# shellcheck disable=SC2016 # single quotes intentional: pattern is a sed regex, not shell expansion
463464
strip_line '^export PATH="\$HOME/\.local/bin:\$PATH"$' "$rc"
464465
rc_localbin_removed=$((rc_localbin_removed + 1))
465466
fi
@@ -516,7 +517,9 @@ uninstall_step_1() {
516517
if grep -q '^# Homebrew$' "$profile" 2>/dev/null \
517518
&& grep -q 'brew shellenv' "$profile" 2>/dev/null; then
518519
strip_line '^# Homebrew$' "$profile"
520+
# shellcheck disable=SC2016 # single quotes intentional: patterns are sed regexes, not shell expansion
519521
strip_line 'eval "\$(/opt/homebrew/bin/brew shellenv)"' "$profile"
522+
# shellcheck disable=SC2016 # single quotes intentional: pattern is a sed regex, not shell expansion
520523
strip_line 'eval "\$(/usr/local/bin/brew shellenv)"' "$profile"
521524
profile_brew_removed=$((profile_brew_removed + 1))
522525
fi

0 commit comments

Comments
 (0)