commit ad6a1c47604069f5ecbd43a3ccb665b5f7bcbc5c
parent 6323ad4b040d40ad448213344f7eba2841e32bc4
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Thu, 12 Nov 2026 22:48:44 -0500
docker/demo.sh: RAM rounded, not floored (a "12 GB" machine's MemTotal is under 12 GiB); a comment names ops_json
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat:
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/docker/demo.sh b/docker/demo.sh
@@ -180,11 +180,12 @@ check_docker() {
ram_gb() {
if [ -r "${MEMINFO}" ]; then
kb="$(sed -n 's/^MemTotal:[[:space:]]*\([0-9]*\) kB/\1/p' "${MEMINFO}")"
- [ -n "${kb}" ] && echo $((kb / 1048576)) && return 0
+ # Rounded, not floored: a "16 GB" machine's MemTotal is about 15.6 GiB.
+ [ -n "${kb}" ] && echo $(((kb + 524288) / 1048576)) && return 0
fi
if command -v sysctl >/dev/null 2>&1; then
b="$(sysctl -n hw.memsize 2>/dev/null || true)"
- [ -n "${b}" ] && echo $((b / 1073741824)) && return 0
+ [ -n "${b}" ] && echo $(((b + 536870912) / 1073741824)) && return 0
fi
echo ""
}
@@ -287,8 +288,8 @@ compose_args() {
}
# Run a docker command, or print it under --dry-run. The words are split on
-# spaces on purpose (every argument here is space-free); a JSON argument goes
-# through `run_json`.
+# spaces on purpose (every argument here is space-free: the model name and the
+# ports are checked above); a JSON argument goes through `ops_json`.
run() {
if [ "${DRY}" = 1 ]; then
printf ' would run: docker %s\n' "$*"