示例#1
0
func saveChromeExtension() error {
	exportPath := filepath.Join(osutil.HomePath(), "AlkasirChromeExtension")
	if err := os.RemoveAll(exportPath); err != nil {
		lg.Errorln(err)
	}
	err := chrome.RestoreAssets(exportPath, "")
	if err != nil {
		return err
	}
	return nil

}
示例#2
0
文件: config.go 项目: thomasf/alkasir
// ConfigPath returns a location for a file or path settings directory
func ConfigPath(file ...string) string {
	var paths []string
	paths = append(paths, osutil.HomePath())

	if runtime.GOOS == "windows" {
		paths = append(paths, "alkasir")
	} else {
		paths = append(paths, ".alkasir")
	}
	if len(file) > 0 {
		paths = append(paths, file...)
	}
	return filepath.Join(paths...)
}