From fb68b269fabd91fc9b4f1b6504f7ae97585be341 Mon Sep 17 00:00:00 2001 From: asoseil Date: Thu, 30 Nov 2017 22:26:28 +0100 Subject: [PATCH] windows fix --- realize/utils.go | 11 ----------- realize/utils_unix.go | 14 ++++++++++++++ realize/utils_windows.go | 2 ++ 3 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 realize/utils_unix.go 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)