@@ -94,7 +94,7 @@ def extract_archive(archive_path: Path | str, extract_path: Path | str) -> Path:
9494 if top_item .is_directory :
9595 extracted_parent_directory = extract_path / top_item .filename
9696
97- if not extracted_parent_directory .exists ():
97+ if not extracted_parent_directory .exists () or not any ( extracted_parent_directory . iterdir ()) :
9898 print (f"Extracting { archive_path } to { extract_path } ..." )
9999 archive .extractall (path = extract_path )
100100 return extracted_parent_directory
@@ -166,7 +166,8 @@ def __init__(
166166 get_archive_extension : Callable [[str ], str ], # returns archive extension based on system
167167 get_platform_string : Callable [[str , str ], str ] = lambda system ,
168168 architecture : f"{ system } -{ architecture } " , # returns platform string used in url_pattern
169- get_extracted_bin_path : Callable [[str ], str ] = lambda _ : "bin" , # returns extracted bin path based on system
169+ get_extracted_bin_path : Callable [[str , str ], str ] = lambda system ,
170+ architecture : "bin" , # returns extracted bin path
170171 cache_directory : Path | str | None = None ,
171172 ):
172173 self .package_name = package_name
@@ -175,7 +176,7 @@ def __init__(
175176 self ._architecture = machine ().lower ()
176177 self ._platform_string = get_platform_string (self ._system , self ._architecture )
177178 self ._extension = get_archive_extension (self ._system )
178- self ._extracted_bin_path = get_extracted_bin_path (self ._system )
179+ self ._extracted_bin_path = get_extracted_bin_path (self ._system , self . _architecture )
179180
180181 self ._cache_directory : Path
181182 if cache_directory is None :
0 commit comments