Skip to content

Commit

Permalink
use abs paths in gen wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
jraymakers committed Jun 23, 2024
1 parent c5dc95f commit d8e8f4e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions generate-wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ def get_lib_file_name():
if __name__ == "__main__":

with tempfile.TemporaryDirectory() as tmp:
dir_path = os.path.dirname(os.path.realpath(__file__))

zip_path = os.path.join(tmp, "libduckdb.zip")
release_zip_url = get_release_zip_url()

Expand All @@ -251,7 +253,7 @@ def get_lib_file_name():

lib_file_name = get_lib_file_name()
zip.extract(lib_file_name, tmp)
shutil.copy(os.path.join(tmp, lib_file_name), os.path.join("lib", "binding", "libduckdb"))
shutil.copy(os.path.join(tmp, lib_file_name), os.path.join(dir_path, "lib", "binding", "libduckdb"))

zip.extract("duckdb.h", "src")
zip.extract("duckdb.h", tmp)
Expand All @@ -263,7 +265,7 @@ def get_lib_file_name():
print("Generating C code and TypeScript definitions")
cpp_result, types_result = create_func_defs(os.path.join(tmp, "duckdb-preprocessed.h"))

out = open(os.path.join("src", "duckdb_node_generated.cpp"), 'wb')
out = open(os.path.join(dir_path, "src", "duckdb_node_generated.cpp"), 'wb')
out.write('''// This file is generated by generate-wrapper.py, please do not edit
#include "duckdb.h"
Expand Down

0 comments on commit d8e8f4e

Please sign in to comment.