Browse Source

avoid unnecessary user home checking

Chris Lu 4 years ago
parent
commit
72b0d9d8c4
1 changed files with 4 additions and 0 deletions
  1. 4 0
      weed/util/file_util.go

+ 4 - 0
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