windows fix
This commit is contained in:
parent
0d2f8856f6
commit
fb68b269fa
@ -79,15 +79,4 @@ func Wdir() string {
|
|||||||
log.Fatal(err.Error())
|
log.Fatal(err.Error())
|
||||||
}
|
}
|
||||||
return dir
|
return dir
|
||||||
}
|
|
||||||
|
|
||||||
// isHidden check if a file or a path is hidden
|
|
||||||
func isHidden(path string) bool {
|
|
||||||
arr := strings.Split(path[len(Wdir()):], "/")
|
|
||||||
for _, elm := range arr {
|
|
||||||
if strings.HasPrefix(elm, ".") {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
14
realize/utils_unix.go
Normal file
14
realize/utils_unix.go
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package realize
|
||||||
|
|
||||||
|
import "strings"
|
||||||
|
|
||||||
|
// isHidden check if a file or a path is hidden
|
||||||
|
func isHidden(path string) bool {
|
||||||
|
arr := strings.Split(path[len(Wdir()):], "/")
|
||||||
|
for _, elm := range arr {
|
||||||
|
if strings.HasPrefix(elm, ".") {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
@ -1,5 +1,7 @@
|
|||||||
package realize
|
package realize
|
||||||
|
|
||||||
|
import "syscall"
|
||||||
|
|
||||||
// isHidden check if a file or a path is hidden
|
// isHidden check if a file or a path is hidden
|
||||||
func isHidden(path string) bool {
|
func isHidden(path string) bool {
|
||||||
p, e := syscall.UTF16PtrFromString(path)
|
p, e := syscall.UTF16PtrFromString(path)
|
||||||
|
Loading…
Reference in New Issue
Block a user