From 35fd5e07e4a2554f62ed350b9d193a255901ce02 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 21 Sep 2026 19:22:54 +0000 Subject: publish-apk: cap the backups it creates Four publishes in one evening left 448MB of .bak copies of a 112MB APK, in a public web directory. A backup policy with no retention becomes the problem it was guarding against. Keeps the two most recent, configurable with --keep. Prunes before copying, so a failed publish doesn't skip the pruning as well. The first version of the test gave all four fixture backups the same mtime, so 'ls -t' ordered them arbitrarily and 'keeps the most recent' proved nothing -- it only failed because the arbitrary order happened to go the wrong way. Worth recording: a test that passes for the wrong reason is the same class of problem as the dead code these guards exist to catch. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_018AwnALZL6bD4VBtATDVv3B --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index eff764a..6e8fc59 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,9 @@ Publishes a built APK to the static site, checking each thing that has gone wrong before: that this is the deploy host and not a box resembling it, that the file is genuinely an APK rather than an HTML error page, that what landed is byte-identical to what was tested, and that the web server serves those same -bytes. Backs up any existing file first. +bytes. Backs up any existing file first, keeping the two most recent (`--keep N`) — each backup is +a full copy of a large APK in a public directory, and four publishes in one evening left +448MB of them. ``` publish-apk app/build/outputs/apk/debug/app-debug.apk listen-debug.apk -- cgit v1.2.3