Commit a24f662d authored by Amos Wenger's avatar Amos Wenger

get rid of go-humanize

parent ba920d42
Pipeline #10806 passed with stage
in 3 minutes and 29 seconds
......@@ -11,10 +11,10 @@ import (
"runtime"
"time"
humanize "github.com/dustin/go-humanize"
"github.com/itchio/arkive/zip"
"github.com/itchio/boar/szextractor/formulas"
"github.com/itchio/boar/szextractor/types"
"github.com/itchio/httpkit/progress"
"github.com/itchio/wharf/eos"
"github.com/itchio/wharf/eos/option"
"github.com/itchio/wharf/state"
......@@ -187,7 +187,7 @@ func EnsureDeps(consumer *state.Consumer) error {
for _, entry := range toFetch {
if entry.Name == zf.Name {
foundFiles++
consumer.Opf("%s (%s)...", entry.Name, humanize.IBytes(uint64(zf.UncompressedSize64)))
consumer.Opf("%s (%s)...", entry.Name, progress.FormatBytes(int64(zf.UncompressedSize64)))
entryPath := filepath.Join(execDir, entry.Name)
err = func() error {
......@@ -222,7 +222,7 @@ func EnsureDeps(consumer *state.Consumer) error {
if foundFiles < len(toFetch) {
return errors.Errorf("Found only %d files of the required %d", foundFiles, len(toFetch))
}
consumer.Statf("Installed %s's worth of dependencies in %s", humanize.IBytes(uint64(installedSize)), time.Since(beforeHeal))
consumer.Statf("Installed %s's worth of dependencies in %s", progress.FormatBytes(installedSize), time.Since(beforeHeal))
return nil
}()
......
......@@ -14,10 +14,9 @@ import (
"text/template"
"time"
humanize "github.com/dustin/go-humanize"
"github.com/itchio/arkive/zip"
"github.com/itchio/boar/szextractor/types"
"github.com/itchio/httpkit/progress"
"github.com/itchio/wharf/eos"
)
......@@ -64,7 +63,7 @@ func main() {
for _, f := range zr.File {
func() {
log.Printf(" - %s (%s)...", f.Name, humanize.IBytes(uint64(f.UncompressedSize64)))
log.Printf(" - %s (%s)...", f.Name, progress.FormatBytes(int64(f.UncompressedSize64)))
de := types.DepEntry{
Name: f.Name,
......
......@@ -10,7 +10,7 @@ import (
"strings"
"time"
humanize "github.com/dustin/go-humanize"
"github.com/itchio/httpkit/progress"
"github.com/itchio/savior"
"github.com/itchio/sevenzip-go/sz"
"github.com/itchio/wharf/archiver"
......@@ -214,7 +214,7 @@ func (se *szExtractor) Resume(checkpoint *savior.ExtractorCheckpoint, sink savio
if len(indices) > 0 {
if isFresh {
se.consumer.Infof("鈬 Pre-allocating %s on disk", humanize.IBytes(uint64(totalBytes)))
se.consumer.Infof("鈬 Pre-allocating %s on disk", progress.FormatBytes(totalBytes))
preallocateItem := func(i int64) error {
item := se.archive.GetItem(int64(i))
defer item.Free()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment