Ignore __MACOSX directory in export template collection ZIP file and project import ZIP file

Update editor/export/export_template_manager.cpp

Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
This commit is contained in:
Malcolm Anderson
2024-12-02 17:50:20 -08:00
parent d741a646a5
commit 2336415623
2 changed files with 32 additions and 2 deletions

View File

@ -437,6 +437,13 @@ bool ExportTemplateManager::_install_file_selected(const String &p_file, bool p_
}
String file = String::utf8(fname);
// Skip the __MACOSX directory created by macOS's built-in file zipper.
if (file.begins_with("__MACOSX")) {
ret = unzGoToNextFile(pkg);
continue;
}
if (file.ends_with("version.txt")) {
Vector<uint8_t> uncomp_data;
uncomp_data.resize(info.uncompressed_size);
@ -512,7 +519,8 @@ bool ExportTemplateManager::_install_file_selected(const String &p_file, bool p_
String file = file_path.get_file();
if (file.size() == 0) {
// Skip the __MACOSX directory created by macOS's built-in file zipper.
if (file.is_empty() || file.begins_with("__MACOSX")) {
ret = unzGoToNextFile(pkg);
continue;
}