Skip to content

Commit 07b92f6

Browse files
siuyutpangaandrew-me
authored andcommitted
fix: use more general method to get home directory
1 parent 356ee51 commit 07b92f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: client/client.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ func NewClient() (tls_client.HttpClient, error) {
3232
options = append(options, proxyOption)
3333
}
3434
} else {
35+
homeDir, _ := os.UserHomeDir()
36+
3537
proxyConfigLocations := []string{
3638
"proxy.txt",
37-
filepath.Join(os.Getenv("HOME"), ".config", "tgpt", "proxy.txt"),
39+
filepath.Join(homeDir, ".config", "tgpt", "proxy.txt"),
3840
}
3941

4042
for _, proxyConfigLocation := range proxyConfigLocations {

0 commit comments

Comments
 (0)