mirror of
https://github.com/ModOrganizer2/modorganizer-basic_games.git
synced 2026-07-27 14:07:29 -07:00
Use glob.escape for paths that contain square brackets (#161)
Co-authored-by: RJ <Liderate@users.noreply.github.com>
This commit is contained in:
+3
-2
@@ -22,13 +22,14 @@ def createPlugins():
|
||||
|
||||
# We are going to list all game plugins:
|
||||
curpath = os.path.abspath(os.path.dirname(__file__))
|
||||
escaped_games_path = glob.escape(os.path.join(curpath, "games"))
|
||||
|
||||
# List all the .ini files:
|
||||
for file in glob.glob(os.path.join(curpath, "games", "*.ini")):
|
||||
for file in glob.glob(os.path.join(escaped_games_path, "*.ini")):
|
||||
game_plugins.append(BasicIniGame(file))
|
||||
|
||||
# List all the python plugins:
|
||||
for file in glob.glob(os.path.join(curpath, "games", "*.py")):
|
||||
for file in glob.glob(os.path.join(escaped_games_path, "*.py")):
|
||||
module_p = os.path.relpath(file, os.path.join(curpath, "games"))
|
||||
if module_p == "__init__.py":
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user