From 53fd7f17f9927501438553584ae7d74ae659e92d Mon Sep 17 00:00:00 2001 From: Nejc Stebe Date: Tue, 14 Jul 2026 09:29:17 +0200 Subject: [PATCH] fix non win compatible date formatting and improve logging --- cli_output/status.py | 4 ++-- install/bash/install.sh | 4 +++- install/powershell/install.ps1 | 6 +++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cli_output/status.py b/cli_output/status.py index e3708e7e..f0dc91e4 100644 --- a/cli_output/status.py +++ b/cli_output/status.py @@ -32,7 +32,7 @@ def _display_credit_line(plan_credits: dict) -> None: # If naive datetime, assume UTC if dt.tzinfo is None: dt = dt.replace(tzinfo=timezone.utc) - formatted_date = dt.strftime("%b %-d, %Y") + formatted_date = f"{dt.strftime('%b')} {dt.day}, {dt.year}" # Check if expired now = datetime.now(timezone.utc) @@ -62,7 +62,7 @@ def _display_bucket_credit_line(bucket: dict, label: str) -> None: # If naive datetime, assume UTC if dt.tzinfo is None: dt = dt.replace(tzinfo=timezone.utc) - formatted_date = dt.strftime("%b %-d, %Y") + formatted_date = f"{dt.strftime('%b')} {dt.day}, {dt.year}" # Check if expired now = datetime.now(timezone.utc) diff --git a/install/bash/install.sh b/install/bash/install.sh index 35bab158..72b55a93 100755 --- a/install/bash/install.sh +++ b/install/bash/install.sh @@ -396,10 +396,12 @@ if [ -n "${CODEPLAIN_API_KEY:-}" ]; then # Ensure the freshly installed tool is findable in this session. export PATH="$HOME/.local/bin:$PATH" echo -e "${GRAY}Verifying your installation...${NC}" - if codeplain --status > /dev/null 2>&1; then + if verify_output=$(codeplain --status 2>&1); then echo -e "${GREEN}✓${NC} Installation verified." else echo -e "${RED}Something went wrong during installation.${NC}" + echo -e "${GRAY}Output of 'codeplain --status':${NC}" + echo "$verify_output" echo -e "${GRAY}Please restart your terminal and try again, or reinstall with:${NC}" echo -e " uv tool install --force codeplain" exit 1 diff --git a/install/powershell/install.ps1 b/install/powershell/install.ps1 index a7418da7..0ac18e80 100644 --- a/install/powershell/install.ps1 +++ b/install/powershell/install.ps1 @@ -426,16 +426,20 @@ if ($downloadExamples -notmatch '^[Nn]$') { if ($env:CODEPLAIN_API_KEY) { Write-Host "${GRAY}Verifying your installation...${NC}" $verifyOk = $false + $verifyOutput = "" try { - & codeplain --status *> $null + $verifyOutput = & codeplain --status 2>&1 | Out-String $verifyOk = ($LASTEXITCODE -eq 0) } catch { + $verifyOutput = $_ | Out-String $verifyOk = $false } if ($verifyOk) { Write-Host "${GREEN}✓${NC} Installation verified." } else { Write-Host "${RED}Something went wrong during installation.${NC}" + Write-Host "${GRAY}Output of 'codeplain --status':${NC}" + Write-Host $verifyOutput Write-Host "${GRAY}Please restart your terminal and try again, or reinstall with:${NC}" Write-Host " uv tool install --force codeplain" exit 1