From da8cefb4fbacd45ab9d2f857fe8e1437983fdbbe Mon Sep 17 00:00:00 2001 From: "alessandro.molina" Date: Thu, 2 Jun 2022 11:05:29 -0400 Subject: [PATCH] Support packages that don't contain package directory --- dukpy/install.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dukpy/install.py b/dukpy/install.py index 2c7c019..1ba738a 100644 --- a/dukpy/install.py +++ b/dukpy/install.py @@ -78,8 +78,9 @@ def install_jspackage(package_name, version, modulesdir): tmpdir = tempfile.mkdtemp() try: tb.extractall(tmpdir) + dirname = os.listdir(tmpdir)[0] shutil.rmtree(os.path.abspath(dest), ignore_errors=True) - shutil.move(os.path.join(tmpdir, 'package'), + shutil.move(os.path.join(tmpdir, dirname), os.path.abspath(dest)) finally: shutil.rmtree(tmpdir)