firstRunEnv returns a minimal environment for a clean first-run test.
(home string)
| 181 | |
| 182 | // firstRunEnv returns a minimal environment for a clean first-run test. |
| 183 | func 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 |
no outgoing calls
no test coverage detected