mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-22 03:46:50 +01:00
Turn custom module paths relative to the engine's directory when they reside inside the engine's folder.
This commit is contained in:
parent
b8c81b5449
commit
4ed0f09f43
@ -429,12 +429,21 @@ void unregister_module_types(ModuleRegistrationLevel p_level) {
|
||||
def convert_custom_modules_path(path):
|
||||
if not path:
|
||||
return path
|
||||
|
||||
path = os.path.realpath(os.path.expanduser(os.path.expandvars(path)))
|
||||
err_msg = "Build option 'custom_modules' must %s"
|
||||
|
||||
if not os.path.isdir(path):
|
||||
raise ValueError(err_msg % "point to an existing directory.")
|
||||
|
||||
if path == os.path.realpath("modules"):
|
||||
raise ValueError(err_msg % "be a directory other than built-in `modules` directory.")
|
||||
|
||||
current_path = os.path.realpath(".")
|
||||
|
||||
if path.startswith(current_path):
|
||||
path = path.replace(current_path, "", 1)
|
||||
|
||||
return path
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user