Skip to content

Commit

Permalink
Deal with macos / juce zip __MACOSX directory stuff (#7254)
Browse files Browse the repository at this point in the history
the __MACOSX directory is special. juce zipfile doesn't treat
it as so. Now we do. Basically.

Closes #7249
  • Loading branch information
baconpaul authored Oct 14, 2023
1 parent ac92a7b commit ef61c49
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/surge-xt/gui/SkinSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,15 @@ void SkinDB::rescanForSkins(SurgeStorage *storage)
{
if (fs::is_directory(d))
{
alldirs.push_back(d);
workStack.push_back(d);
if (d.path().filename().u8string() == "__MACOSX")
{
// skip this mis-zipped dir. See #7249
}
else
{
alldirs.push_back(d);
workStack.push_back(d);
}
}
}
}
Expand Down
13 changes: 13 additions & 0 deletions src/surge-xt/gui/SurgeGUIEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,19 @@ class DroppedUserDataHandler
<< std::endl;
return false;
}

// mac zip can create a place for the finder bundle that juce
// unzips as opposed to applies. Nuke it. See #7249
if (fs::is_directory(uncompressTo / "__MACOSX"))
{
try
{
fs::remove_all(uncompressTo / "__MACOSX");
}
catch (const fs::filesystem_error &)
{
}
}
return true;
}

Expand Down

0 comments on commit ef61c49

Please sign in to comment.