From 7fb60dc4e454e885f75137328ff026dc1f4a4fed Mon Sep 17 00:00:00 2001 From: Lander Visterin Date: Mon, 3 Jul 2023 14:08:41 +0200 Subject: [PATCH] fix: normalizePath tilde expansion on Windows normalizePath sometimes gets backslash paths as input. In such case it will not be able to act on the ~/ prefix, since it will be \~ instead. FromSlash will provide the correct variant. --- internal/core/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/core/util.go b/internal/core/util.go index 1ef4ce61..e497a8f2 100755 --- a/internal/core/util.go +++ b/internal/core/util.go @@ -233,7 +233,7 @@ func normalizePath(path string) string { } if path == "~" { return homedir - } else if strings.HasPrefix(path, "~/") { + } else if strings.HasPrefix(path, filepath.FromSlash("~/")) { path = filepath.Join(homedir, path[2:]) } return path