1
0
Fork 0
mirror of https://github.com/Luzifer/share.git synced 2024-12-20 10:31:16 +00:00

Put progress bar on Stderr

in order to have the URL output pipeable

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2022-12-12 15:44:37 +01:00
parent 982edcf1e2
commit f2e3eebbac
Signed by: luzifer
GPG key ID: D91C3E91E4CAD6F5

View file

@ -9,6 +9,7 @@ import (
"io" "io"
"io/ioutil" "io/ioutil"
"mime" "mime"
"os"
"path" "path"
"strings" "strings"
"time" "time"
@ -73,6 +74,7 @@ func executeUpload(inFileName string, inFileHandle io.ReadSeeker, useCalculatedF
if cfg.Progress { if cfg.Progress {
bar := pb.New64(ps.Size).Prefix(inFileName).SetUnits(pb.U_BYTES) bar := pb.New64(ps.Size).Prefix(inFileName).SetUnits(pb.U_BYTES)
bar.Output = os.Stderr
bar.Start() bar.Start()
barUpdate := true barUpdate := true