Fixed .sln generation (a little) and changed config to create one .pdb per target.
This commit is contained in:
@@ -37,19 +37,22 @@ def _download_file(url: str, path: pathlib.Path) -> None:
|
||||
urllib.request.urlretrieve(url, dl_path)
|
||||
dl_path.rename(path)
|
||||
|
||||
def _extract_file(path: pathlib.Path, output_dir: str, archive_type: ArchiveType, skip_folders: int) -> None:
|
||||
def _extract_file(path: pathlib.Path, output_dir: str, archive_type: ArchiveType, skip_folders: int = 0) -> None:
|
||||
if archive_type == ArchiveType.TAR_GZ:
|
||||
file = tarfile.open(str(path))
|
||||
filter = tarfile.data_filter
|
||||
if skip_folders != 0:
|
||||
def skip_filer(member: tarfile.TarInfo, path: str) -> tarfile.TarInfo:
|
||||
name_parts = member.name.split('/')
|
||||
def skip_filter(member: tarfile.TarInfo, path: str) -> tarfile.TarInfo:
|
||||
name_parts = member.name.split('/', skip_folders)
|
||||
if len(name_parts) <= skip_folders:
|
||||
return None
|
||||
return member.replace(name = '/'.join(name_parts[skip_folders:]))
|
||||
file.extraction_filter = skip_filer
|
||||
file.extractall(output_dir)
|
||||
filter = skip_filter
|
||||
file.extractall(output_dir, filter=filter)
|
||||
file.close()
|
||||
elif archive_type == ArchiveType.ZIP:
|
||||
if skip_folders != 0:
|
||||
raise Exception('skip_folders option is not yet supported for zip-archives :()')
|
||||
file = zipfile.open(str(path))
|
||||
file.extractall(output_dir)
|
||||
file.close()
|
||||
|
||||
Reference in New Issue
Block a user