Skip to content

[dotfiles-improvement] fix: add command -v happy guard to claude() default-mode branch - #529

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
fix/dotfiles-happy-command-guard-65e5689ca4cf1925
Draft

[dotfiles-improvement] fix: add command -v happy guard to claude() default-mode branch#529
github-actions[bot] wants to merge 1 commit into
mainfrom
fix/dotfiles-happy-command-guard-65e5689ca4cf1925

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

What

The claude() function in zsh/aliases/claude-copilot.zsh calls happy in its default mode branch without checking whether the binary exists. If happy is not installed, the user gets a raw command not found: happy error with no actionable guidance.

Change

Add the same guard pattern already used by c() and claude-review() in misc.zsh:

if ! command -v happy &>/dev/null && ! whence -p claude &>/dev/null; then
    echo "❌ Neither happy nor claude binary found. Install Claude Code CLI." >&2
    return 1
fi

This checks for either the happy binary or the external claude binary (via whence -p, which searches PATH only, not shell functions) before attempting to invoke happy.

No behavior change when tools are present

Generated by Dotfiles Improvement Scanner · ● 30.6M ·

The claude() function calls `happy` in its default-mode branch without
checking whether the binary exists. If `happy` is not installed the
user sees a raw 'command not found: happy' error with no guidance.

Apply the same guard pattern already used in c() and claude-review()
in misc.zsh: check for either `happy` or the external `claude` binary
via `whence -p`, and emit the standard install hint on failure.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants