This commit is contained in:
Séra Zoltán 2021-01-15 10:29:58 +02:00 committed by Márk Sági-Kazár
parent e606f7496e
commit 46a61e6fbd

14
util.go
View file

@ -95,19 +95,7 @@ func absPathify(inPath string) string {
inPath = userHomeDir() + inPath[5:] inPath = userHomeDir() + inPath[5:]
} }
if strings.HasPrefix(inPath, "$") { inPath = os.ExpandEnv(inPath)
end := strings.Index(inPath, string(os.PathSeparator))
var value, suffix string
if end == -1 {
value = os.Getenv(inPath[1:])
} else {
value = os.Getenv(inPath[1:end])
suffix = inPath[end:]
}
inPath = value + suffix
}
if filepath.IsAbs(inPath) { if filepath.IsAbs(inPath) {
return filepath.Clean(inPath) return filepath.Clean(inPath)