Exclude macOS metadata
This commit is contained in:
@@ -64,6 +64,8 @@ void ApplyAllCustomPatches()
|
||||
try {
|
||||
for (std::filesystem::path p : std::filesystem::directory_iterator("patches"))
|
||||
{
|
||||
if (std::filesystem::path(p).filename().string()._Starts_with("._")) continue; // exclude macOS metadata
|
||||
|
||||
std::string extension = std::filesystem::path(p).extension().string();
|
||||
if ((extension == ".p" || extension == ".P" || extension == ".p2" || extension == ".P2"))
|
||||
{
|
||||
|
||||
@@ -220,6 +220,8 @@ void FindFiles(WIN32_FIND_DATAW* fd)
|
||||
do {
|
||||
if (!(fd->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
|
||||
{
|
||||
if (fd->cFileName[0] == '.' && fd->cFileName[1] == '_') continue; // exclude macOS metadata
|
||||
|
||||
if (!_wcsicmp(fd->cFileName, L"Patches.dva") || !_wcsicmp(fd->cFileName, L"Render.dva"))
|
||||
{
|
||||
DeleteFileW(fd->cFileName);
|
||||
|
||||
@@ -425,6 +425,8 @@ std::vector<PluginInfo> LoadPlugins()
|
||||
do {
|
||||
if (!(ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
|
||||
{
|
||||
if (ffd.cFileName[0] == '.' && ffd.cFileName[1] == '_') continue; // exclude macOS metadata
|
||||
|
||||
auto pos = wcslen(ffd.cFileName);
|
||||
|
||||
if (ffd.cFileName[pos - 4] == '.' &&
|
||||
@@ -509,6 +511,8 @@ std::vector<PluginInfo> LoadCustom()
|
||||
do {
|
||||
if (!(ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
|
||||
{
|
||||
if (ffd.cFileName[0] == '.' && ffd.cFileName[1] == '_') continue; // exclude macOS metadata
|
||||
|
||||
auto pos = wcslen(ffd.cFileName);
|
||||
|
||||
if ((ffd.cFileName[pos - 2] == '.' && (ffd.cFileName[pos - 1] == 'p' || ffd.cFileName[pos - 1] == 'P')) ||
|
||||
|
||||
Reference in New Issue
Block a user