-
Notifications
You must be signed in to change notification settings - Fork 222
支持环境变量G_HOME自定义g目录 #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
// ghome 返回g根目录
func ghome() (dir string) {
if dir = os.Getenv("G_HOME"); dir != "" {
return dir
}
homeDir, _ := os.UserHomeDir()
return filepath.Join(homeDir, ".g")
} |
|
同感 |
const (
experimentalEnv = "G_EXPERIMENTAL"
homeEnv = "G_HOME"
)
func ghome() (dir string) {
if experimental := os.Getenv(experimentalEnv); experimental == "true" {
if dir = os.Getenv(homeEnv); dir != "" {
return dir
}
}
homeDir, _ := os.UserHomeDir()
return filepath.Join(homeDir, ".g")
} |
这样设计很奇怪不是么,g 默认安装下是不会设置 多弄一个 |
我也觉得有点多余 |
环境变量明明设置了,为啥不管用啊,还是装在C盘的默认目录;用的1.2版本,G_HOME和G_EXXXXXX也配置了 |
|
G_HOME
G_HOME
值为空,则读取默认路径~/.g
The text was updated successfully, but these errors were encountered: