func (u UserProfileConfig) Path() string {
	return u.path
}
Path returns the user profile path
package git
import "fmt"
import "os"
import "strings"
import "github.com/codeskyblue/go-sh"
import "github.com/go-ini/ini"
import "github.com/gesquive/git-user/user"
type UserProfileConfig struct {
	path    string
	iniFile *ini.File
}
func NewUserProfileConfig(hintPath string) (*UserProfileConfig, error) {
	defaultProfilePath := user.ExpandHomeDir("~/.git_profiles")
	config := new(UserProfileConfig)
	if _, err := os.Stat(hintPath); err == nil {
		config.path = user.ExpandHomeDir(hintPath)
	} else {
		out, err := sh.Command("git", "config", "user.profiles").Output()
		if err == nil && len(out) > 0 {
			config.path = user.ExpandHomeDir(strings.TrimSpace(string(out)))
		} else {
			sh.Command("git", "config", "--global", "user.profiles", defaultProfilePath)
			config.path = defaultProfilePath
		}
	}
	if len(config.path) == 0 {
		err := fmt.Errorf("No config path could be found.")
		return nil, err
	}
	var iniFile *ini.File
	if _, err := os.Stat(config.path); os.IsNotExist(err) {
		iniFile = ini.Empty()
	} else {
		iniFile, err = ini.Load(config.path)
		if err != nil {
			return nil, err
		}
	}
	config.iniFile = iniFile
	return config, nil
}
func (u UserProfileConfig) save() (err error) {
	err = u.iniFile.SaveTo(u.path)
	return
}