mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-10-04 00:03:59 +00:00
fix(clawhubadapter): manager CLI improvements, pysimulator updates, sidecar fixes
This commit is contained in:
@ -9,6 +9,7 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
@ -162,6 +163,22 @@ func launchProcess(bin, arg, dir, name string) (*sidecarProcess, error) {
|
||||
cmd.Dir = dir
|
||||
cmd.Stderr = os.Stderr
|
||||
|
||||
// Add openclaw CLI bin dir to PATH so subprocesses can exec 'openclaw' command
|
||||
if SimulatorDir != "" {
|
||||
binDir := filepath.Join(SimulatorDir, "bin")
|
||||
if info, err := os.Stat(binDir); err == nil && info.IsDir() {
|
||||
env := os.Environ()
|
||||
binDirPath := binDir + string(os.PathListSeparator)
|
||||
for i, e := range env {
|
||||
if strings.HasPrefix(e, "PATH=") {
|
||||
env[i] = "PATH=" + binDirPath + e[5:]
|
||||
break
|
||||
}
|
||||
}
|
||||
cmd.Env = env
|
||||
}
|
||||
}
|
||||
|
||||
stdin, err := cmd.StdinPipe()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("stdin pipe: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user