From 9acff3aaaa6e74a844b4972df9b5d05464d8751e Mon Sep 17 00:00:00 2001 From: TJ Hoplock Date: Fri, 13 Oct 2023 01:04:22 -0400 Subject: [PATCH] feat: add `IsHidden` func to util pkg --- pkg/utils/utils.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 3c7d685..8d0c977 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -6,6 +6,7 @@ import ( "io/fs" "os" "path/filepath" + "strings" ) // GetFilesInDirectory is a convenience function to DRY out some of the @@ -77,3 +78,7 @@ func GetHostname() string { h, _ := os.Hostname() return h } + +func IsHidden(path string) bool { + return strings.HasPrefix(path, ".") +}