Skip to content

Commit

Permalink
fix: use shutil instead of zipfile
Browse files Browse the repository at this point in the history
  • Loading branch information
devrimyatar committed Apr 29, 2022
1 parent fe7a3c5 commit c0a0cde
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jans-linux-setup/jans_setup/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ def extract_setup():
jans_zip = zipfile.ZipFile(jans_zip_file)
parent_dir = jans_zip.filelist[0].orig_filename

tmp_dir = './' + os.urandom(4).hex()
jans_zip.extractall(tmp_dir)
shutil.copytree(os.path.join(tmp_dir, parent_dir, 'jans-linux-setup/jans_setup'), argsp.setup_dir)
unpack_dir = os.path.join(jans_app_dir, os.urandom(4).hex())
shutil.unpack_archive(jans_zip_file, unpack_dir)
shutil.copytree(os.path.join(unpack_dir, parent_dir, 'jans-linux-setup/jans_setup'), argsp.setup_dir)
jans_zip.close()
shutil.rmtree(tmp_dir)
shutil.rmtree(unpack_dir)

target_setup = os.path.join(argsp.setup_dir, 'setup.py')
if not os.path.exists(target_setup):
Expand Down

0 comments on commit c0a0cde

Please sign in to comment.