Browse Source

Fixed isHidden error on non window platform

TC pushbot 5 4 years ago
parent
commit
f852430aad
2 changed files with 4 additions and 4 deletions
  1. 1 1
      mod/filesystem/fileOpr.go
  2. 3 3
      mod/filesystem/hidden/hide.go

+ 1 - 1
mod/filesystem/fileOpr.go

@@ -349,7 +349,7 @@ func insideHiddenFolder(path string) bool {
 	thisPathInfo := filepath.ToSlash(filepath.Clean(path))
 	pathData := strings.Split(thisPathInfo, "/")
 	for _, thispd := range pathData {
-		if thispd[:1] == "." {
+		if len(thispd) > 0 && thispd[:1] == "." {
 			//This path contain one of the folder is hidden
 			return true
 		}

+ 3 - 3
mod/filesystem/hidden/hide.go

@@ -18,10 +18,10 @@ func hide(filename string) error {
 	return nil
 }
 
-func isHidden(filename string) bool {
+func isHidden(filename string) (bool, error) {
 	if len(filepath.Base(filename)) > 0 && filepath.Base(filename)[0:1] == "." {
-		return true
+		return true, nil
 	}
 
-	return false
+	return false, nil
 }