diff --git a/kit/log.go b/kit/log.go index 87b0ca78..9b21b40d 100644 --- a/kit/log.go +++ b/kit/log.go @@ -110,6 +110,10 @@ func InitLog(logname string) { LogInfo("InitLog ==============================", "date", date, "logname", logname) } +func LogFatal(err error) { + TheLog.Fatal(err) +} + func SummarizeLog(fname string) error { file, err := os.Open(fname) if err != nil { diff --git a/kit/misc.go b/kit/misc.go index 165ff444..e3ece52d 100644 --- a/kit/misc.go +++ b/kit/misc.go @@ -73,14 +73,12 @@ func MIDIFilePath(nm string) string { func LocalPaletteDir() string { localapp := os.Getenv("CommonProgramFiles") if localapp == "" { - var err error - tempdir, err := GetParam("global.tempdir") - LogWarn("Expecting CommonProgramFiles to be set, using global.tempdir value", "tempdir", tempdir) - if err != nil { - LogIfError(err) - return "" + home := os.Getenv("HOME") + localapp = filepath.Join(home,"commonfiles","Palette") + if err := os.MkdirAll(localapp, os.ModePerm); err != nil { + LogFatal(err) } - localapp = tempdir + LogInfo("LocalPaletteDir using HOME","localapp",localapp) } return filepath.Join(localapp, "Palette") }