Skip to content

fix: show Upsun disk sizes on macOS without numfmt - #178

Open
stantheman0128 wants to merge 2 commits into
Annertech:mainfrom
stantheman0128:fix/mac-disk-size-without-numfmt
Open

stantheman0128 wants to merge 2 commits into
Annertech:mainfrom
stantheman0128:fix/mac-disk-size-without-numfmt

Conversation

@stantheman0128

Copy link
Copy Markdown

Summary

Fixes #155.

upsun_disk_helper formatted byte counts with GNU numfmt. This Mac has no numfmt (command not found). format_iec prints the same 1024-based sizes with python3: 1048576 is 1.00M, and a storage value already in mebibytes is scaled by 1048576 first, matching --from-unit=1048576.

prepared with Cursor

Verification

Red, this Mac:

numfmt --to iec --format "%3.2f" 1048576
exit 127
numfmt: command not found

Green:

bash tests/upsun-disk-darwin.test.sh
upsun disk darwin ok (numfmt exit 127, 1MiB 1.00M, 5 units 5.00M)

ddev was not run. The test only checks the two conversions the helper used to hand to numfmt.

Made with Cursor

stantheman0128 and others added 2 commits September 23, 2026 10:30
macOS does not ship numfmt, so ddev ucc stopped before it could
show assigned and available storage.

Co-authored-by: Cursor <cursoragent@cursor.com>
The Darwin check was matching its own explanation.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

numfmt not available on macOS

1 participant