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 diff --git a/internal/core/util_test.go b/internal/core/util_test.go index ca1169f5..1da71e9e 100755 --- a/internal/core/util_test.go +++ b/internal/core/util_test.go @@ -55,7 +55,7 @@ func TestNormalizePath(t *testing.T) { t.Log("os.UserHomeDir failed, will not proceed with tests") return } - stylesPathInput := "~/.vale" + stylesPathInput := filepath.FromSlash("~/.vale") expectedOutput := filepath.Join(homedir, ".vale") result := normalizePath(stylesPathInput) if result != expectedOutput {