Print progress at once off a terminal, keep stderr to one writer (closes #13)
check / check (push) Successful in 1m25s

On a pipe, a file or /dev/null each scan phase now prints its zero-state
line the moment it starts instead of after its first finished item, so
a slow first read under cron no longer leaves the log silent. Terminal
detection uses golang.org/x/term, now a direct dependency listed in the
README; the old character-device test took /dev/null for a terminal.
The walk spinner no longer redraws from the library's own goroutine; it
advances only as items complete, so a redraw cannot garble a warning.
Building the bar moved into newBar so the terminal display can be
tested without a terminal.

Lint suppressed: gosec on two test file opens, paralleltest on three
tests that replace os.Stderr.

Model: opus-5-5
This commit is contained in:
2026-10-03 13:26:35 +00:00
parent c9bf22d483
commit f9ba1a3c5a
5 changed files with 189 additions and 20 deletions
+3
View File
@@ -29,6 +29,9 @@
# Completed Steps
- progress prints at once on a non-terminal, uses a real terminal test,
and has a single writer to stderr (2026-10-03,
https://git.eeqj.de/sneak/sfdupes/issues/13)
- stamp the git tag or short commit in a plain `docker build .`
instead of `dev` (2026-10-02, branch `next`, closes
https://git.eeqj.de/sneak/sfdupes/issues/67): `.dockerignore` now