mirror of
https://github.com/openharmony/developtools_global_resource_tool.git
synced 2026-07-19 19:33:46 -04:00
!46 【Master】增量编译场景下,针对占用的目录删除不了时,继续编译。
Merge pull request !46 from fyz1019/master
This commit is contained in:
+6
-1
@@ -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()) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user