@@ -34,6 +34,8 @@ type autocompleteScript struct {
34
34
ShellConfigurationFile map [string ]string
35
35
}
36
36
37
+ var homePath , _ = os .UserHomeDir ()
38
+
37
39
// autocompleteScripts regroups the autocomplete scripts for the different shells
38
40
// The key is the path of the shell.
39
41
var autocompleteScripts = map [string ]autocompleteScript {
@@ -63,8 +65,8 @@ var autocompleteScripts = map[string]autocompleteScript{
63
65
` ,
64
66
CompleteScript : `eval "$(scw autocomplete script shell=bash)"` ,
65
67
ShellConfigurationFile : map [string ]string {
66
- "darwin" : path .Join (os . Getenv ( "HOME" ) , ".bash_profile" ),
67
- "linux" : path .Join (os . Getenv ( "HOME" ) , ".bashrc" ),
68
+ "darwin" : path .Join (homePath , ".bash_profile" ),
69
+ "linux" : path .Join (homePath , ".bashrc" ),
68
70
},
69
71
},
70
72
"fish" : {
@@ -87,8 +89,8 @@ var autocompleteScripts = map[string]autocompleteScript{
87
89
` ,
88
90
CompleteScript : `eval (scw autocomplete script shell=fish)` ,
89
91
ShellConfigurationFile : map [string ]string {
90
- "darwin" : path .Join (os . Getenv ( "HOME" ) , ".config/fish/config.fish" ),
91
- "linux" : path .Join (os . Getenv ( "HOME" ) , ".config/fish/config.fish" ),
92
+ "darwin" : path .Join (homePath , ".config/fish/config.fish" ),
93
+ "linux" : path .Join (homePath , ".config/fish/config.fish" ),
92
94
},
93
95
},
94
96
"zsh" : {
@@ -109,8 +111,8 @@ var autocompleteScripts = map[string]autocompleteScript{
109
111
` ,
110
112
CompleteScript : `eval "$(scw autocomplete script shell=zsh)"` ,
111
113
ShellConfigurationFile : map [string ]string {
112
- "darwin" : path .Join (os . Getenv ( "HOME" ) , ".zshrc" ),
113
- "linux" : path .Join (os . Getenv ( "HOME" ) , ".zshrc" ),
114
+ "darwin" : path .Join (homePath , ".zshrc" ),
115
+ "linux" : path .Join (homePath , ".zshrc" ),
114
116
},
115
117
},
116
118
}
0 commit comments