Skip to content

Commit baf9f16

Browse files
author
Théo LAGACHE
committed
chore(release): 26.01.6
1 parent 5f61991 commit baf9f16

3 files changed

Lines changed: 30 additions & 8 deletions

File tree

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ keywords:
2222
- management
2323
- integration
2424
license: Apache-2.0
25-
version: 26.01.5
25+
version: 26.01.6
2626
date-released: "2026-01-15"

core/updater.py

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,36 @@ def update_cli():
158158
console.print(f"[info]Target installation path: {current_exe}[/info]")
159159

160160
download_url = asset["browser_download_url"]
161-
temp_file = Path(f"/tmp/portabase_update") if system != "windows" else Path(f"{current_exe}.new")
161+
import tempfile
162+
# Create a temporary file that won't have permission issues or conflicts
163+
fd, temp_path = tempfile.mkstemp(prefix="portabase_update_")
164+
temp_file = Path(temp_path)
165+
os.close(fd)
162166

163-
with console.status(f"[bold magenta]Downloading {asset_name}...[/bold magenta]"):
164-
response = requests.get(download_url, stream=True)
167+
try:
168+
response = requests.get(download_url, stream=True, timeout=15)
165169
response.raise_for_status()
166-
with open(temp_file, "wb") as f:
167-
for chunk in response.iter_content(chunk_size=8192):
168-
f.write(chunk)
170+
total_size = int(response.headers.get('content-length', 0))
171+
172+
from rich.progress import Progress, SpinnerColumn, TextColumn, BarColumn, DownloadColumn, TransferSpeedColumn
173+
174+
with Progress(
175+
SpinnerColumn(),
176+
TextColumn("[progress.description]{task.description}"),
177+
BarColumn(),
178+
DownloadColumn(),
179+
TransferSpeedColumn(),
180+
console=console
181+
) as progress:
182+
task = progress.add_task(f"Downloading {asset_name}...", total=total_size)
183+
with open(temp_file, "wb") as f:
184+
for chunk in response.iter_content(chunk_size=8192):
185+
if chunk:
186+
f.write(chunk)
187+
progress.update(task, advance=len(chunk))
188+
except Exception as e:
189+
if temp_file.exists(): temp_file.unlink()
190+
raise e
169191

170192
if system != "windows":
171193
temp_file.chmod(0o755)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "portabase-cli"
3-
version = "26.01.5"
3+
version = "26.01.6"
44
description = "The official command line interface (CLI) for managing and deploying Portabase instances with ease."
55
readme = "README.md"
66
requires-python = ">=3.12"

0 commit comments

Comments
 (0)