mirror of
https://github.com/openharmony/developtools_global_resource_tool.git
synced 2026-07-18 09:14:48 -04:00
!249 删除文件前判断文件是否存在
Merge pull request !249 from liduo/fix_mac_delete_error
This commit is contained in:
@@ -297,6 +297,9 @@ bool FileEntry::IsIgnore(const string &filename) const
|
||||
bool FileEntry::RemoveAllDirInner(const FileEntry &entry)
|
||||
{
|
||||
string path = entry.GetFilePath().GetPath();
|
||||
if (!Exist(path)) {
|
||||
return true;
|
||||
}
|
||||
if (entry.IsFile()) {
|
||||
#ifdef _WIN32
|
||||
bool result = remove(AdaptLongPath(path).c_str()) == 0;
|
||||
|
||||
@@ -90,7 +90,12 @@ bool ResourceAppend::Combine(const string &folderPath)
|
||||
.FormatCause(child->GetFilePath().GetPath().c_str(), "not a file"));
|
||||
return false;
|
||||
}
|
||||
if (child->GetFilePath().GetFilename() == ID_DEFINED_FILE) {
|
||||
const std::string fileName = child->GetFilePath().GetFilename();
|
||||
if (fileName == ID_DEFINED_FILE) {
|
||||
continue;
|
||||
}
|
||||
if (fileName.find('.') == 0) {
|
||||
// The file starts with '.' is invalid
|
||||
continue;
|
||||
}
|
||||
if (!LoadResourceItem(child->GetFilePath().GetPath())) {
|
||||
|
||||
Reference in New Issue
Block a user