Move log to user owned directory

This commit is contained in:
AI Bot
2026-05-03 21:29:49 +02:00
committed by Riyyi
parent 7c4b0eda8b
commit b04869f0e1
4 changed files with 38 additions and 15 deletions
+21
View File
@@ -0,0 +1,21 @@
package lib
import (
"os"
"path/filepath"
"strings"
)
// -----------------------------------------
// public
func ExpandPath(path string) string {
if strings.HasPrefix(path, "~/") {
home, err := os.UserHomeDir()
if err != nil {
return path
}
return filepath.Join(home, path[2:])
}
return path
}