Skip to content

Commit

Permalink
Don't generate __pycache__.pak.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoikas committed Jun 4, 2020
1 parent e3d6a86 commit 58cecb6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Sources/Plasma/Apps/plPythonPack/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,18 @@ You can contact Cyan Worlds, Inc. by email [email protected]
#include <string>
#include <algorithm>
#include <string_theory/stdio>
#include <unordered_set>

static const char* kPackFileName = "python.pak";
static const char* kModuleFile = "__init__.py";

/** Directories that should not generate their own .pak file. */
static const std::unordered_set<ST::string, ST::hash_i, ST::equal_i> s_ignoreSubdirs{
ST_LITERAL("plasma"),
ST_LITERAL("system"),
ST_LITERAL("__pycache__"),
};

#if HS_BUILD_FOR_WIN32
#define NULL_DEVICE "NUL:"
#else
Expand Down Expand Up @@ -216,7 +224,7 @@ void FindSubDirs(std::vector<plFileName> &dirnames, const plFileName &path)
std::vector<plFileName> subdirs = plFileSystem::ListSubdirs(path);
for (auto iter = subdirs.begin(); iter != subdirs.end(); ++iter) {
ST::string name = iter->GetFileName();
if (name.compare_i("system") != 0 && name.compare_i("plasma") != 0)
if (s_ignoreSubdirs.find(name) == s_ignoreSubdirs.end())
dirnames.push_back(name);
}
}
Expand Down

0 comments on commit 58cecb6

Please sign in to comment.