fixed publish command

This commit is contained in:
2026-01-18 21:35:26 +11:00
parent ba466e7549
commit 19e4d212ce

View File

@@ -41,9 +41,11 @@ def publish(args):
with console.status("Compressing...", spinner="bouncingBall", spinner_style="blue") as status:
# compress to a tar file
with tempfile.TemporaryFile(mode="wb+") as f:
tar_file = tarfile.open(fileobj=f, mode="w:gz")
f = tempfile.TemporaryFile(mode="wb+")
with tarfile.open(fileobj=f, mode="w:gz") as tar_file:
tar_file.add(args.folder_path, arcname=os.path.basename(args.folder_path))
f.flush()
f.seek(0)
console.print("[d][:white_check_mark:] Compressed![/]")
@@ -55,7 +57,7 @@ def publish(args):
auth=HTTPBasicAuth(username, password)
)
tar_file.close()
f.close()
if response.status_code == 401:
console.print("[b red]digpkg: failed to publish mineral: authentication failed[/]")
@@ -69,4 +71,3 @@ def publish(args):
response.raise_for_status()
console.print("[d][:white_check_mark:] Uploaded![/]")