MCPcopy Create free account
hub / github.com/astercloud/aster / executeScript

Method executeScript

pkg/commands/executor.go:69–80  ·  view source on GitHub ↗

executeScript 执行前置脚本

(ctx context.Context, scriptPath string)

Source from the content-addressed store, hash-verified

67
68// executeScript 执行前置脚本
69func (e *Executor) executeScript(ctx context.Context, scriptPath string) error {
70 result, err := e.sandbox.Exec(ctx, "bash "+scriptPath, nil)
71 if err != nil {
72 return err
73 }
74
75 if result.Code != 0 {
76 return fmt.Errorf("script failed with code %d: %s", result.Code, result.Stderr)
77 }
78
79 return nil
80}
81
82// renderPrompt 渲染提示词模板
83func (e *Executor) renderPrompt(template string, args map[string]string) string {

Callers 1

ExecuteMethod · 0.95

Calls 1

ExecMethod · 0.65

Tested by

no test coverage detected