Humanize file sizes in gen output, clean up temp on signal
- Humanize file sizes in verbose file listing (e.g., "76.8 MiB" not "76836984 bytes") - Add signal handler to clean up temp file on Ctrl-C/SIGTERM during gen
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/dustin/go-humanize"
|
||||
"github.com/spf13/afero"
|
||||
"sneak.berlin/go/mfer/internal/log"
|
||||
"sneak.berlin/go/mfer/mfer"
|
||||
@@ -354,7 +355,7 @@ func (s *Scanner) ToManifest(ctx context.Context, w io.Writer, progress chan<- S
|
||||
return err
|
||||
}
|
||||
|
||||
log.Verbosef("+ %s (%d bytes)", entry.Path, bytesRead)
|
||||
log.Verbosef("+ %s (%s)", entry.Path, humanize.IBytes(uint64(bytesRead)))
|
||||
|
||||
scannedFiles++
|
||||
scannedBytes += bytesRead
|
||||
|
||||
Reference in New Issue
Block a user