feat: cache + paths #1

Merged
fmartingr merged 5 commits from feat/cache into main 2025-03-23 23:46:28 +01:00
Showing only changes of commit 92732f9682 - Show all commits

20
paths/user.go Normal file
View file

@ -0,0 +1,20 @@
package paths
import (
"os/user"
"path/filepath"
"strings"
)
func ExpandUser(providedPath string) string {
var path string = providedPath
usr, _ := user.Current()
dir := usr.HomeDir
if providedPath == "~" {
path = dir
} else if strings.HasPrefix(providedPath, "~/") {
path = filepath.Join(dir, providedPath[2:])
}
return path
}