Compare commits

...

1 Commits
main ... v0.2.5

Author SHA1 Message Date
ce8b292026 get cmd: delete archive by default, add option to keep files 2025-04-17 11:49:41 +02:00
2 changed files with 20 additions and 2 deletions

View File

@ -1,6 +1,6 @@
[project]
name = "pycage"
version = "0.2.4"
version = "0.2.5"
description = "tool to handle standalone Python installations from the CLI"
authors = [
{name = "Florian Förster", email = "f.foerster@d-opt.com"},
@ -78,7 +78,7 @@ directory = "reports/coverage"
[tool.bumpversion]
current_version = "0.2.4"
current_version = "0.2.5"
parse = """(?x)
(?P<major>0|[1-9]\\d*)\\.
(?P<minor>0|[1-9]\\d*)\\.

View File

@ -113,6 +113,14 @@ def extract_archive(
default=None,
help="specifiy a different target location, default: current working directory",
)
@click.option(
"-k",
"--keep",
is_flag=True,
show_default=True,
default=False,
help="keep the downloaded archive",
)
@click.option(
"-f",
"--force-reextract",
@ -133,6 +141,7 @@ def get(
release_tag: str | None,
force_reextract: bool,
dl_folder: Path | None,
keep: bool,
) -> None:
url_metadata = cast(str, config.CFG["metadata"]["URL"])
os_file_info = config.CFG.os_info
@ -179,3 +188,12 @@ def get(
)
except Exception as err:
print_error(err)
if not keep:
try:
src_file.unlink()
except Exception as err:
click.echo(
"The archive file could not be deleted because of following exception..."
)
print_error(err)