Skip to content

Commit 021117f

Browse files
Your Nameclaude
andcommitted
Fix shellcheck errors
- Remove unused variables (subcommand, SOURCE_SCOPE) - Fix backtick interpretation in info message - Use compgen instead of ls | grep - Disable SC2015 (intentional A && B || C pattern) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent a44ee53 commit 021117f

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

agent-persona

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env bash
2+
# shellcheck disable=SC2015
23
set -euo pipefail
34

45
# agent-persona — tool-agnostic persona launcher for AI coding agents
@@ -345,7 +346,7 @@ agent-persona gemini my-persona
345346
- On Linux, `agent-persona` prefers a bind-mount overlay via `unshare` (no on-disk changes).
346347
- If `unshare` isn’t available, it falls back to swap-and-restore. If you hard-kill the tool, run `agent-persona recover`.
347348
README
348-
info " - README.md (how `.personas/` works)"
349+
info " - README.md (how .personas/ works)"
349350
else
350351
info " - README.md already exists"
351352
fi
@@ -496,7 +497,6 @@ cmd_which() {
496497
cd "$root" && root="$(pwd -P)"
497498

498499
local PREFER_REPO="${AGENT_PERSONA_PREFER_REPO:-1}"
499-
local SOURCE_SCOPE="${AGENT_PERSONA_SOURCE:-}"
500500
local PERSONA_HOME="${AGENT_PERSONA_HOME:-$HOME/.local/share/agent-persona}"
501501
local EXTRA_PATHS="${AGENT_PERSONA_PATHS:-}"
502502

@@ -712,7 +712,6 @@ cmd_list() {
712712
root="$(pwd -P)"
713713

714714
local PREFER_REPO="${AGENT_PERSONA_PREFER_REPO:-1}"
715-
local SOURCE_SCOPE="${AGENT_PERSONA_SOURCE:-}"
716715
local PERSONA_HOME="${AGENT_PERSONA_HOME:-$HOME/.local/share/agent-persona}"
717716
local EXTRA_PATHS="${AGENT_PERSONA_PATHS:-}"
718717

@@ -828,15 +827,13 @@ case "$invoked" in
828827
esac
829828

830829
persona=""
831-
subcommand=""
832830
pass_args=()
833831

834832
while [[ $# -gt 0 ]]; do
835833
case "$1" in
836834
# Subcommands
837835
init)
838-
subcommand="init"; shift
839-
cmd_init "$@"; exit $?
836+
shift; cmd_init "$@"; exit $?
840837
;;
841838
doctor)
842839
cmd_doctor; exit $?
@@ -931,7 +928,6 @@ root="$(pwd -P)"
931928

932929
# --- Resolve persona ---
933930
PREFER_REPO="${AGENT_PERSONA_PREFER_REPO:-1}"
934-
SOURCE_SCOPE="${AGENT_PERSONA_SOURCE:-}"
935931
PERSONA_HOME="${AGENT_PERSONA_HOME:-$HOME/.local/share/agent-persona}"
936932
EXTRA_PATHS="${AGENT_PERSONA_PATHS:-}"
937933

uninstall.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
2929
fi
3030

3131
# Check for orphaned backups first
32-
if [[ -d "$STATE_DIR" ]] && ls "$STATE_DIR"/*.backup 2>/dev/null | grep -q .; then
32+
if [[ -d "$STATE_DIR" ]] && compgen -G "$STATE_DIR/*.backup" >/dev/null 2>&1; then
3333
warn "Orphaned backups exist. Run 'agent-persona recover' first?"
3434
read -p "Continue anyway? [y/N] " -n 1 -r
3535
echo ""

0 commit comments

Comments
 (0)