From 37bf2f134f36a76c7287756b2f20823fe500589b Mon Sep 17 00:00:00 2001 From: liduo Date: Fri, 11 Apr 2025 15:01:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=81=E8=AE=B8=E8=BF=87=E6=BB=A4rawfile/res?= =?UTF-8?q?file=E6=A0=B9=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liduo --- src/binary_file_packer.cpp | 4 ++++ src/resource_util.cpp | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/binary_file_packer.cpp b/src/binary_file_packer.cpp index baacddd..9e291a0 100644 --- a/src/binary_file_packer.cpp +++ b/src/binary_file_packer.cpp @@ -79,6 +79,10 @@ uint32_t BinaryFilePacker::CopyBinaryFile(const string &filePath, const string & return RESTOOL_ERROR; } + if (ResourceUtil::IsIgnoreFile(fileType, false)) { + return RESTOOL_SUCCESS; + } + string dst = FileEntry::FilePath(packageParser_.GetOutput()).Append(RESOURCES_DIR).Append(fileType).GetPath(); if (CopyBinaryFileImpl(filePath, dst) != RESTOOL_SUCCESS) { return RESTOOL_ERROR; diff --git a/src/resource_util.cpp b/src/resource_util.cpp index 0600f4e..d0392e4 100644 --- a/src/resource_util.cpp +++ b/src/resource_util.cpp @@ -251,15 +251,15 @@ bool ResourceUtil::IsIgnoreFile(const string &filename, bool isFile) { map regexs; std::string regexSources; + string key = filename; if (g_isUseCustomRegex) { regexs = g_userIgnoreFileRegex; regexSources = "user"; } else { regexs = DEFAULT_IGNORE_FILE_REGEX; regexSources = "default"; + transform(key.begin(), key.end(), key.begin(), ::tolower); } - string key = filename; - transform(key.begin(), key.end(), key.begin(), ::tolower); for (const auto &iter : regexs) { if ((iter.second == IgnoreType::IGNORE_FILE && !isFile) || (iter.second == IgnoreType::IGNORE_DIR && isFile)) {