// getConfigPath get users config path func getConfigPath() (string, *probe.Error) { if customConfigPath != "" { return customConfigPath, nil } homeDir, e := user.HomeDir() if e != nil { return "", probe.NewError(e) } configPath := filepath.Join(homeDir, ".minio") return configPath, nil }
// getWebConfigDir get web config dir. func getWebConfigDir() (string, *probe.Error) { if customWebConfigDir != "" { return customWebConfigDir, nil } homeDir, e := user.HomeDir() if e != nil { return "", probe.NewError(e) } webConfigDir := filepath.Join(homeDir, ".minio", "web") return webConfigDir, nil }
func getFSMultipartsSessionConfigPath() (string, *probe.Error) { if customMultipartsConfigPath != "" { return customMultipartsConfigPath, nil } homeDir, e := user.HomeDir() if e != nil { return "", probe.NewError(e) } fsMultipartsConfigPath := filepath.Join(homeDir, ".minio", "$multiparts-session.json") return fsMultipartsConfigPath, nil }
func getFSBucketsConfigPath() (string, *probe.Error) { if customBucketsConfigPath != "" { return customBucketsConfigPath, nil } homeDir, e := user.HomeDir() if e != nil { return "", probe.NewError(e) } fsBucketsConfigPath := filepath.Join(homeDir, ".minio", "$buckets.json") return fsBucketsConfigPath, nil }
// getMcConfigDir - construct minio client config folder. func getMcConfigDir() (string, *probe.Error) { if mcCustomConfigDir != "" { return mcCustomConfigDir, nil } homeDir, e := user.HomeDir() if e != nil { return "", probe.NewError(e) } // For windows the path is slightly different switch runtime.GOOS { case "windows": return filepath.Join(homeDir, globalMCConfigWindowsDir), nil default: return filepath.Join(homeDir, globalMCConfigDir), nil } }
func (s *MySuite) TestHomeDir(c *C) { _, err := user.HomeDir() c.Assert(err, IsNil) }