feat: allow for setup.sh based user fixtures

This commit is contained in:
2026-03-21 11:20:29 +00:00
parent cf9330e483
commit d72f727322
10 changed files with 222 additions and 45 deletions
+4 -3
View File
@@ -79,16 +79,17 @@ func buildRecordShellScript() string {
return string(body)
}
func recordSessionEnv(sandbox recordSandbox, sandboxConfig map[string]string) []string {
return recordSessionEnvWithExtra(sandbox, sandboxConfig, nil)
func recordSessionEnv(sandbox recordSandbox, sandboxConfig map[string]string, setupScripts []string) []string {
return recordSessionEnvWithExtra(sandbox, sandboxConfig, setupScripts, nil)
}
func recordSessionEnvWithExtra(sandbox recordSandbox, sandboxConfig, extraEnv map[string]string) []string {
func recordSessionEnvWithExtra(sandbox recordSandbox, sandboxConfig map[string]string, setupScripts []string, extraEnv map[string]string) []string {
env := append([]string{}, os.Environ()...)
env = append(env,
"MIRO_HOST_HOME="+sandbox.hostHome,
"MIRO_HOST_TMP="+sandbox.hostTmp,
"MIRO_PATH_ENV="+sandbox.pathEnv,
setupScriptsEnvName+"="+strings.Join(setupScripts, "\n"),
)
for _, key := range sortedKeys(sandboxConfig) {
env = append(env, sandboxEnvName(key)+"="+sandboxConfig[key])