chore: 完善个模块打包
This commit is contained in:
@@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user