From 41c800740752c5e7ab389ea963ce134170c94d3f Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 30 Sep 2024 12:37:16 +0000 Subject: [PATCH] Hack for setup.py --- setup.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index b5531b2..b231422 100644 --- a/setup.py +++ b/setup.py @@ -11,14 +11,15 @@ # Copy the compiled frontend files into the 'static' directory # Required for MANIFEST.in to work correctly -src_dir = pathlib.Path('frontend/dist/static') -dst_dir = pathlib.Path('inventree_wireviz/static') +here = pathlib.Path(__file__).parent.absolute() -# Clean out the destination directory -if dst_dir.exists(): - shutil.rmtree(dst_dir) +# Copy the compiled frontend files into the 'static' directory +src_dir = here.joinpath('frontend/dist/static').resolve() +dst_dir = here.joinpath('inventree_wireviz/static').resolve() -shutil.copytree(src_dir, dst_dir) +if src_dir.exists(): + print("Copying frontend files from", src_dir, "to", dst_dir) + shutil.copytree(src_dir, dst_dir, dirs_exist_ok=True) setuptools.setup( name="inventree-wireviz-plugin",