diff options
| author | Grail Finder <wohilas@gmail.com> | 2026-03-14 11:06:18 +0300 |
|---|---|---|
| committer | Grail Finder <wohilas@gmail.com> | 2026-03-14 11:06:18 +0300 |
| commit | 92acfb7ed4cda8e93909eadb54863012eac45128 (patch) | |
| tree | 937d2104bfbc32d0683d0d3b90533d6828e32120 /tools/chain.go | |
| parent | 2901208c800742cb7b5980e7e203655bf7dee4b4 (diff) | |
Feat: run sed
Diffstat (limited to 'tools/chain.go')
| -rw-r--r-- | tools/chain.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/chain.go b/tools/chain.go index fb7767e..73ab6cd 100644 --- a/tools/chain.go +++ b/tools/chain.go @@ -266,6 +266,18 @@ func execBuiltin(name string, args []string, stdin string) string { } fsRootDir = abs return fmt.Sprintf("Changed directory to: %s", fsRootDir) + case "go": + // Allow all go subcommands + if len(args) == 0 { + return "[error] usage: go <subcommand> [options]" + } + cmd := exec.Command("go", args...) + cmd.Dir = fsRootDir + output, err := cmd.CombinedOutput() + if err != nil { + return fmt.Sprintf("[error] go %s: %v\n%s", args[0], err, string(output)) + } + return string(output) } return "" } |
