From 8837869222bab88b2081c47a9d5ddb69ab264468 Mon Sep 17 00:00:00 2001 From: Tim Thompson Date: Fri, 29 Dec 2023 16:47:32 -0800 Subject: [PATCH] unix debugging --- kit/misc.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/kit/misc.go b/kit/misc.go index e3ece52d..726a21c2 100644 --- a/kit/misc.go +++ b/kit/misc.go @@ -71,16 +71,20 @@ func MIDIFilePath(nm string) string { // LocalPaletteDir gets used for local (and changed) things in saved and config func LocalPaletteDir() string { - localapp := os.Getenv("CommonProgramFiles") - if localapp == "" { + commonfilepath := os.Getenv("CommonProgramFiles") + if commonfilepath == "" { home := os.Getenv("HOME") - localapp = filepath.Join(home,"commonfiles","Palette") - if err := os.MkdirAll(localapp, os.ModePerm); err != nil { - LogFatal(err) + commonfilepath = filepath.Join(home,"commonfiles") + palettedir := filepath.Join(commonfilepath,"Palette") + if err := os.MkdirAll(palettedir, os.ModePerm); err != nil { + fmt.Printf("Unable to create %s\n",palettedir) + panic(err) } - LogInfo("LocalPaletteDir using HOME","localapp",localapp) + // DO NOT USE Log* functions here + fmt.Printf("HOME palettedir = %s\n",palettedir) + return palettedir } - return filepath.Join(localapp, "Palette") + return filepath.Join(commonfilepath, "Palette") } var DataDir = "data" // default, override with environment variable