config: keep configDir empty when homedir errors
@@ -28,12 +28,11 @@ var (
func init() {
if configDir == "" {
homedir, err := os.UserHomeDir()
- if err != nil {
- panic(err)
- }
+ if err == nil {
configDir = filepath.Join(homedir, configFileDir)
}
}
+}
// Dir returns the directory the configuration file is stored in
func Dir() string {
