fix: doctor gives copy-pasteable statusLine fix with actual discovered path
When the status-line helper is found but Claude settings are misconfigured, the fix suggestion now shows the real path (e.g. /c/Users/Warren/...) instead of a <you> placeholder. Always suggests the .sh variant even if only .ps1 was found, since Claude Code runs statusLine through bash. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+12
-1
@@ -7,6 +7,7 @@ import (
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/warrenronsiek/ctask/internal/config"
|
||||
@@ -132,7 +133,17 @@ func runDoctor(cmd *cobra.Command, args []string) error {
|
||||
if !statusLineConfigured {
|
||||
fmt.Printf(" [FAIL] Claude Code status line not configured or misconfigured\n")
|
||||
fmt.Printf(" Fix: add to %s:\n", claudeSettingsPath)
|
||||
if runtime.GOOS == "windows" {
|
||||
if statusLineFound {
|
||||
// Derive the .sh path from whatever was found (could be .ps1 fallback).
|
||||
// Claude Code always needs the bash variant.
|
||||
shPath := strings.TrimSuffix(statusLinePath, filepath.Ext(statusLinePath)) + ".sh"
|
||||
bashPath := filepath.ToSlash(shPath)
|
||||
// Convert Windows drive letter for Git Bash: C:\... -> /c/...
|
||||
if len(bashPath) >= 2 && bashPath[1] == ':' {
|
||||
bashPath = "/" + strings.ToLower(string(bashPath[0])) + bashPath[2:]
|
||||
}
|
||||
fmt.Printf(" \"statusLine\": {\"type\": \"command\", \"command\": \"bash %s\"}\n", bashPath)
|
||||
} else if runtime.GOOS == "windows" {
|
||||
fmt.Printf(" \"statusLine\": {\"type\": \"command\", \"command\": \"bash /c/Users/<you>/AppData/Local/ctask/bin/ctask-statusline.sh\"}\n")
|
||||
} else {
|
||||
fmt.Printf(" \"statusLine\": {\"type\": \"command\", \"command\": \"bash ~/.local/bin/ctask-statusline.sh\"}\n")
|
||||
|
||||
Reference in New Issue
Block a user