Point `os.homedir()` at `home`: it reads USERPROFILE on Windows, HOME elsewhere.
(home: string | undefined, profile: string | undefined = home)
| 457 | |
| 458 | /** Point `os.homedir()` at `home`: it reads USERPROFILE on Windows, HOME elsewhere. */ |
| 459 | function setHome(home: string | undefined, profile: string | undefined = home): void { |
| 460 | if (home === undefined) delete process.env.HOME; |
| 461 | else process.env.HOME = home; |
| 462 | if (profile === undefined) delete process.env.USERPROFILE; |
| 463 | else process.env.USERPROFILE = profile; |
| 464 | } |
| 465 | |
| 466 | /** |
| 467 | * A temp folder holding a private home with its own `.ssh` and `.config`, and |
no outgoing calls
no test coverage detected