fix(convoy): capture stderr for 'couldn't track issue' warnings

The bd dep add command was failing with only "exit status 1" shown
because stderr wasn't being captured. Now shows actual error message.

Fixes: gt-g8eqq5

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gastown/crew/gus
2026-01-17 00:37:50 -08:00
committed by Steve Yegge
parent 0cc4867ad7
commit 8880c61067

View File

@@ -344,9 +344,15 @@ func runConvoyCreate(cmd *cobra.Command, args []string) error {
depArgs := []string{"dep", "add", convoyID, issueID, "--type=tracks"}
depCmd := exec.Command("bd", depArgs...)
depCmd.Dir = townBeads
var depStderr bytes.Buffer
depCmd.Stderr = &depStderr
if err := depCmd.Run(); err != nil {
style.PrintWarning("couldn't track %s: %v", issueID, err)
errMsg := strings.TrimSpace(depStderr.String())
if errMsg == "" {
errMsg = err.Error()
}
style.PrintWarning("couldn't track %s: %s", issueID, errMsg)
} else {
trackedCount++
}
@@ -434,9 +440,15 @@ func runConvoyAdd(cmd *cobra.Command, args []string) error {
depArgs := []string{"dep", "add", convoyID, issueID, "--type=tracks"}
depCmd := exec.Command("bd", depArgs...)
depCmd.Dir = townBeads
var depStderr bytes.Buffer
depCmd.Stderr = &depStderr
if err := depCmd.Run(); err != nil {
style.PrintWarning("couldn't add %s: %v", issueID, err)
errMsg := strings.TrimSpace(depStderr.String())
if errMsg == "" {
errMsg = err.Error()
}
style.PrintWarning("couldn't add %s: %s", issueID, errMsg)
} else {
addedCount++
}