diff --git a/src/file_entry.cpp b/src/file_entry.cpp index ef6cc1c..26d844d 100644 --- a/src/file_entry.cpp +++ b/src/file_entry.cpp @@ -280,7 +280,12 @@ bool FileEntry::IsIgnore(const string &filename) const bool FileEntry::RemoveAllDirInner(const FileEntry &entry) { if (entry.IsFile()) { - return remove(entry.GetFilePath().GetPath().c_str()) == 0; + bool result = remove(entry.GetFilePath().GetPath().c_str()) == 0; + if (!result) { + cerr << "Error: " << entry.GetFilePath().GetPath() << "remove fail !" << endl; + return false; + } + return true; } for (const auto &iter : entry.GetChilds()) { diff --git a/src/resource_pack.cpp b/src/resource_pack.cpp index 9fe369f..6fa33e9 100644 --- a/src/resource_pack.cpp +++ b/src/resource_pack.cpp @@ -125,6 +125,7 @@ uint32_t ResourcePack::InitOutput() const } bool forceWrite = packageParser_.GetForceWrite(); + bool combine = packageParser_.GetCombine(); string output = packageParser_.GetOutput(); string resourcesPath = FileEntry::FilePath(output).Append(RESOURCES_DIR).GetPath(); if (ResourceUtil::FileExist(resourcesPath)) { @@ -134,7 +135,7 @@ uint32_t ResourcePack::InitOutput() const } if (!ResourceUtil::RmoveAllDir(resourcesPath)) { - return RESTOOL_ERROR; + return combine ? RESTOOL_SUCCESS : RESTOOL_ERROR; } } return RESTOOL_SUCCESS;