Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions commands/daemon.install.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ func commandDaemonInstall(c *cli.Context) error {
// Resolve daemon binary (Homebrew/PATH preferred, curl-installer fallback)
daemonBinPath, err := model.ResolveDaemonBinaryPath()
if err != nil {
color.Yellow.Println("⚠️ shelltime-daemon not found.")
color.Red.Println(" shelltime-daemon binary not found.")
color.Yellow.Println("Install via Homebrew: brew install shelltime/tap/shelltime")
color.Yellow.Println("Or via curl installer: curl -sSL https://shelltime.xyz/i | bash")
return nil
return fmt.Errorf("shelltime-daemon binary not found: %w", err)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The error message wrapping here is redundant. The err returned by model.ResolveDaemonBinaryPath() already contains a descriptive message (e.g., "shelltime-daemon not found on PATH..."). Additionally, a similar message is already printed to the console on line 45. Wrapping it with the same prefix results in a repetitive output like shelltime-daemon binary not found: shelltime-daemon not found on PATH.... Returning the error directly is cleaner and avoids unnecessary redundancy.

Suggested change
return fmt.Errorf("shelltime-daemon binary not found: %w", err)
return err

}
color.Green.Printf("✅ Found daemon binary at: %s\n", daemonBinPath)

Expand Down
Loading