From 72b0d9d8c4bc79d1571c6c770443dcade846d5cc Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 22 Feb 2021 16:50:56 -0800 Subject: [PATCH] avoid unnecessary user home checking --- weed/util/file_util.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/weed/util/file_util.go b/weed/util/file_util.go index 70135180d..f83f80265 100644 --- a/weed/util/file_util.go +++ b/weed/util/file_util.go @@ -69,6 +69,10 @@ func CheckFile(filename string) (exists, canRead, canWrite bool, modTime time.Ti func ResolvePath(path string) string { + if !strings.Contains(path, "~") { + return path + } + usr, _ := user.Current() dir := usr.HomeDir