feat: add basic forked shell record to in/out files

This commit is contained in:
2026-03-18 11:14:06 +00:00
parent d331b0825d
commit 081e338744
9 changed files with 386 additions and 38 deletions
+10 -1
View File
@@ -7,7 +7,8 @@ import (
"strings"
)
// Record creates the requested directory path under the resolved test directory.
// Record creates the requested scenario path under the resolved test directory
// and records an interactive shell session into in/out fixtures when saved.
func Record(path string) (string, error) {
testDir, err := ResolveTestDir()
if err != nil {
@@ -23,6 +24,14 @@ func Record(path string) (string, error) {
return "", err
}
if err := recordScenario(target, recordIO{
in: os.Stdin,
out: os.Stdout,
err: os.Stderr,
}); err != nil {
return "", err
}
return target, nil
}