From 498137fa8e19b261dbab4b1e91f4534d398d7c12 Mon Sep 17 00:00:00 2001 From: Virgil Date: Sat, 4 Apr 2026 01:19:59 +0000 Subject: [PATCH] refactor(process): align Program with AX helpers Co-Authored-By: Virgil --- program.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/program.go b/program.go index 192a3ee..cf5cb94 100644 --- a/program.go +++ b/program.go @@ -3,10 +3,9 @@ package process import ( "bytes" "context" - "fmt" "os/exec" - "strings" + core "dappco.re/go/core" coreerr "dappco.re/go/core/log" ) @@ -48,7 +47,7 @@ func (p *Program) Find() error { } path, err := exec.LookPath(p.Name) if err != nil { - return coreerr.E("Program.Find", fmt.Sprintf("%q: not found in PATH", p.Name), ErrProgramNotFound) + return coreerr.E("Program.Find", core.Sprintf("%q: not found in PATH", p.Name), ErrProgramNotFound) } p.Path = path return nil @@ -94,7 +93,7 @@ func (p *Program) RunDir(ctx context.Context, dir string, args ...string) (strin } if err := cmd.Run(); err != nil { - return strings.TrimSpace(out.String()), coreerr.E("Program.RunDir", fmt.Sprintf("%q: command failed", p.Name), err) + return core.Trim(out.String()), coreerr.E("Program.RunDir", core.Sprintf("%q: command failed", p.Name), err) } - return strings.TrimSpace(out.String()), nil + return core.Trim(out.String()), nil }