chore: 完善个模块打包

This commit is contained in:
zhaoyupeng
2026-01-07 18:55:22 +08:00
parent eb87d6fbed
commit aafe60ee35
29 changed files with 851 additions and 287 deletions

View File

@@ -1,6 +1,7 @@
package maker
import (
"bytes"
"context"
"fmt"
"os/exec"
@@ -18,9 +19,13 @@ func (m *maker) RunCommand(ctx context.Context, dir string, _cmds ...string) err
cmd.Dir = dir
}
var buf bytes.Buffer
cmd.Stdout = &buf
cmd.Stderr = &buf
// Execute the command
if err := cmd.Run(); err != nil {
return fmt.Errorf("failed to run command '%s' in directory '%s': %w", cmdStr, dir, err)
return fmt.Errorf("failed to run command '%s' in directory '%s': %w, output = %s", cmdStr, dir, err, buf.String())
}
}