MCPcopy Create free account
hub / github.com/github/gh-aw / runCommandInDir

Function runCommandInDir

pkg/cli/file_tracker_test.go:174–184  ·  view source on GitHub ↗

Helper function to run commands in a specific directory

(cmd []string, dir string)

Source from the content-addressed store, hash-verified

172
173// Helper function to run commands in a specific directory
174func runCommandInDir(cmd []string, dir string) error {
175 if len(cmd) == 0 {
176 return nil
177 }
178 command := cmd[0]
179 args := cmd[1:]
180
181 c := exec.Command(command, args...)
182 c.Dir = dir
183 return c.Run()
184}
185
186func TestFileTracker_RollbackAllFiles(t *testing.T) {
187 // Create a temporary directory for testing

Calls 1

RunMethod · 0.45

Tested by

no test coverage detected