Skip to content

Commit

Permalink
gh-19: Fix some issues with relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeyman192 committed Nov 4, 2024
1 parent 206beac commit 8b0cb16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions pymhf/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ def kill_injected_code(loop: asyncio.AbstractEventLoop):
_preinject_shellcode = f.read()
pm_binary.inject_python_shellcode(_preinject_shellcode)
# Inject the common NMS variables which are required for general use.
module_path = op.realpath(module_path)
module_path = module_path.replace("\\", "\\\\")
pm_binary.inject_python_shellcode(
f"""
Expand Down
7 changes: 3 additions & 4 deletions pymhf/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,13 @@ def canonicalize_setting(
print("Critical Error: Cannot find user directory. Ensure APPDATA environment variable is set")
exit()
if plugin_name is not None:
return op.join(appdata_data, "pymhf", plugin_name, *_suffix)
return op.realpath(op.join(appdata_data, "pymhf", plugin_name, *_suffix))
else:
raise ValueError("{USER_DIR} cannot be used for single-file mods.")
elif tag == "EXE_DIR":
if exe_dir:
return op.join(exe_dir, *_suffix)
return op.realpath(op.join(exe_dir, *_suffix))
else:
raise ValueError("Exe directory cannot be determined")
elif tag == "CURR_DIR":
print(module_dir, _suffix)
return op.join(module_dir, *_suffix)
return op.realpath(op.join(module_dir, *_suffix))

0 comments on commit 8b0cb16

Please sign in to comment.