mirror of
https://github.com/mudler/luet.git
synced 2025-09-05 09:10:43 +00:00
Restore parsing of gentoo string with condition (#195)
* cmd/helpers: Permit to parse gentoo package str with condition * Update vendor pkgs-checker @v0.8.1
This commit is contained in:
13
vendor/github.com/spf13/viper/util.go
generated
vendored
13
vendor/github.com/spf13/viper/util.go
generated
vendored
@@ -91,13 +91,22 @@ func insensitiviseMap(m map[string]interface{}) {
|
||||
func absPathify(inPath string) string {
|
||||
jww.INFO.Println("Trying to resolve absolute path to", inPath)
|
||||
|
||||
if strings.HasPrefix(inPath, "$HOME") {
|
||||
if inPath == "$HOME" || strings.HasPrefix(inPath, "$HOME"+string(os.PathSeparator)) {
|
||||
inPath = userHomeDir() + inPath[5:]
|
||||
}
|
||||
|
||||
if strings.HasPrefix(inPath, "$") {
|
||||
end := strings.Index(inPath, string(os.PathSeparator))
|
||||
inPath = os.Getenv(inPath[1:end]) + inPath[end:]
|
||||
|
||||
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) {
|
||||
|
Reference in New Issue
Block a user