diff --git a/realize/utils.go b/realize/utils.go index eaf6dfd..7228c9e 100644 --- a/realize/utils.go +++ b/realize/utils.go @@ -79,15 +79,4 @@ func Wdir() string { log.Fatal(err.Error()) } 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 } \ No newline at end of file diff --git a/realize/utils_unix.go b/realize/utils_unix.go new file mode 100644 index 0000000..a6ed554 --- /dev/null +++ b/realize/utils_unix.go @@ -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 +} diff --git a/realize/utils_windows.go b/realize/utils_windows.go index d520f86..51d5fce 100644 --- a/realize/utils_windows.go +++ b/realize/utils_windows.go @@ -1,5 +1,7 @@ package realize +import "syscall" + // isHidden check if a file or a path is hidden func isHidden(path string) bool { p, e := syscall.UTF16PtrFromString(path)