MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / runHTTPSSetupCommand

Function runHTTPSSetupCommand

scripts/https_setup_test.go:501–523  ·  view source on GitHub ↗
(t *testing.T, configPath string, input string, extraEnv map[string]string)

Source from the content-addressed store, hash-verified

499}
500
501func runHTTPSSetupCommand(t *testing.T, configPath string, input string, extraEnv map[string]string) (string, error) {
502 t.Helper()
503
504 scriptDir, err := os.Getwd()
505 if err != nil {
506 t.Fatalf("os.Getwd() error = %v", err)
507 }
508
509 tempDir := t.TempDir()
510 cmd := exec.Command("sh", "./https-setup.sh")
511 cmd.Dir = scriptDir
512 cmd.Env = append(os.Environ(),
513 "CONFIG_FILE="+configPath,
514 "TMPDIR="+tempDir,
515 )
516 for key, value := range extraEnv {
517 cmd.Env = append(cmd.Env, key+"="+value)
518 }
519 cmd.Stdin = strings.NewReader(input)
520
521 output, err := cmd.CombinedOutput()
522 return string(output), err
523}

Callers 2

runHTTPSSetupFunction · 0.85
runHTTPSSetupExpectErrorFunction · 0.85

Calls 1

CommandMethod · 0.45

Tested by

no test coverage detected