File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -244,8 +244,6 @@ def _download_and_extract(self, filename: str) -> pathlib.Path:
244244 print (f"> reusing local file { fpath } " )
245245
246246 print ("> extracting archive" )
247- # extract into current folder (all files are inside an in-tar folder)
248- shutil .unpack_archive (fpath , self .base_dir , self .archive_format )
249247
250248 # nightly have different download name and extracted folder name as it
251249 # uses a redirect
@@ -255,6 +253,9 @@ def _download_and_extract(self, filename: str) -> pathlib.Path:
255253 folder = pathlib .Path (pathlib .Path (tar .firstmember .name ).parts [0 ])
256254 else :
257255 folder = fpath .with_name (fpath .name .replace (self .archive_suffix , "" ))
256+ # unless for ZIP, extract to current folder (all files inside an in-tar folder)
257+ extract_to = folder if self .archive_format == "zip" else self .base_dir
258+ shutil .unpack_archive (fpath , extract_to , self .archive_format )
258259
259260 return folder
260261
@@ -267,6 +268,7 @@ def _install_from(self, folder: pathlib.Path):
267268 shutil .rmtree (self .base_dir / "include" / "zim" , ignore_errors = True )
268269
269270 # copy new zim headers
271+ (self .base_dir / "include" ).mkdir (exist_ok = True , parents = True )
270272 shutil .move (folder / "include" / "zim" , self .base_dir / "include" / "zim" )
271273
272274 # copy new libs
You can’t perform that action at this time.
0 commit comments