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)) {