From 9fc3b12a7f21ea80901ba0a1408ad7d39cf93946 Mon Sep 17 00:00:00 2001 From: Perfect Makanju Date: Mon, 16 Nov 2020 15:30:39 +0000 Subject: [PATCH] Fix: Ignore .DS_Store and other meta files (#256) --- core/textile/utils/utils.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/core/textile/utils/utils.go b/core/textile/utils/utils.go index b4b95763..ab2ad967 100644 --- a/core/textile/utils/utils.go +++ b/core/textile/utils/utils.go @@ -145,14 +145,18 @@ func RandBytes(size int) ([]byte, error) { return b, err } +var metaFileNames = map[string]bool{ + ".textileseed": true, + ".textile": true, + ".DS_Store": true, + ".Trashes": true, + ".localized": true, +} + func IsMetaFileName(pathOrName string) bool { _, name := filepath.Split(pathOrName) - if name == ".textileseed" || name == ".textile" { - return true - } - - return false + return metaFileNames[name] } const threadIDStoreKey = "thread_id"