MCPcopy Index your code
hub / github.com/cheat/cheat / firstRunEnv

Function firstRunEnv

test/integration/first_run_integration_test.go:183–203  ·  view source on GitHub ↗

firstRunEnv returns a minimal environment for a clean first-run test.

(home string)

Source from the content-addressed store, hash-verified

181
182// firstRunEnv returns a minimal environment for a clean first-run test.
183func firstRunEnv(home string) []string {
184 env := []string{
185 "PATH=" + os.Getenv("PATH"),
186 }
187
188 switch runtime.GOOS {
189 case "windows":
190 env = append(env,
191 "APPDATA="+filepath.Join(home, "AppData", "Roaming"),
192 "USERPROFILE="+home,
193 "SystemRoot="+os.Getenv("SystemRoot"),
194 )
195 default:
196 env = append(env,
197 "HOME="+home,
198 "EDITOR=vi",
199 )
200 }
201
202 return env
203}
204
205// parseCreatedConfPath extracts the config file path from the installer's
206// "Created config file: <path>" output. The message may appear mid-line

Callers 1

TestFirstRunIntegrationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected