Skip to content

Commit 7142784

Browse files
committed
fix: path expansion
1 parent 9e7f3fe commit 7142784

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

export.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ def get_config_options(bv: BinaryView):
4343
dependency_name = bn.TextLineField("Dependency Name (optional):")
4444
bn.get_form_input([lib_name, alternate_names, export_path, dependency_name], "Export as Type Library Options")
4545

46-
config = {"lib_name": lib_name.result, "alternate_names": alternate_names.result, "export_path": export_path.result,
46+
config = {"lib_name": lib_name.result, "alternate_names": alternate_names.result, "export_path": os.path.expanduser(export_path.result),
4747
"dependency_name": dependency_name.result}
4848
return config
4949

5050

5151
def export_functions(bv: BinaryView):
5252
log = bv.create_logger("TypeLib_Exporter")
5353
config = get_config_options(bv)
54-
if not os.path.exists(os.path.dirname(os.path.expanduser(config['export_path']))):
54+
if not os.path.exists(os.path.dirname(config['export_path'])):
5555
log.log_error(f"Please specify a path to export the type library: {config['export_path']}")
5656
return
5757
if len(config["lib_name"]) == 0:
@@ -69,4 +69,4 @@ def export_functions(bv: BinaryView):
6969
typelib = create_type_library(log, bv, export_funcs, config)
7070
typelib.finalize()
7171
log.log_info(f"Exported {len(export_funcs)} functions to {config['export_path']}")
72-
typelib.write_to_file(os.path.expanduser(config['export_path']))
72+
typelib.write_to_file(config['export_path'])

0 commit comments

Comments
 (0)