chore(deps): update module github.com/schollz/progressbar/v3 to v3.19.1 #876
@@ -19,7 +19,7 @@ require (
|
||||
github.com/moby/sys/signal v0.7.1
|
||||
github.com/moby/term v0.5.2
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/schollz/progressbar/v3 v3.19.0
|
||||
github.com/schollz/progressbar/v3 v3.19.1
|
||||
golang.org/x/term v0.44.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
gotest.tools/v3 v3.5.2
|
||||
@@ -77,7 +77,7 @@ require (
|
||||
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
|
||||
github.com/lucasb-eyer/go-colorful v1.4.0 // indirect
|
||||
github.com/mattn/go-colorable v0.1.14 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/mattn/go-isatty v0.0.22 // indirect
|
||||
github.com/mattn/go-localereader v0.0.1 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.21 // indirect
|
||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
|
||||
|
||||
@@ -623,8 +623,8 @@ github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHP
|
||||
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
|
||||
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattn/go-isatty v0.0.22 h1:j8l17JJ9i6VGPUFUYoTUKPSgKe/83EYU2zBC7YNKMw4=
|
||||
github.com/mattn/go-isatty v0.0.22/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4=
|
||||
github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4=
|
||||
github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88=
|
||||
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
|
||||
@@ -808,8 +808,8 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf
|
||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4=
|
||||
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
|
||||
github.com/schollz/progressbar/v3 v3.19.0 h1:Ea18xuIRQXLAUidVDox3AbwfUhD0/1IvohyTutOIFoc=
|
||||
github.com/schollz/progressbar/v3 v3.19.0/go.mod h1:IsO3lpbaGuzh8zIMzgY3+J8l4C8GjO0Y9S69eFvNsec=
|
||||
github.com/schollz/progressbar/v3 v3.19.1 h1:iv8BgwOvdML/S3p84uBpy/IMigv4U9594vPZYa2EdrU=
|
||||
github.com/schollz/progressbar/v3 v3.19.1/go.mod h1:LFL7jqimKxfhero4K1eCkUr/6R39AgQeiPCJtlTWIW8=
|
||||
github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U=
|
||||
github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo=
|
||||
github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg=
|
||||
@@ -1139,7 +1139,6 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw=
|
||||
golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
|
||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
ARG GO_VERSION=1.20.8
|
||||
ARG ALPINE_VERSION=3.24
|
||||
ARG ALPINE_VERSION=3.18
|
||||
ARG XX_VERSION=1.2.1
|
||||
|
||||
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//go:build (appengine || js || nacl || tinygo || wasm) && !windows
|
||||
// +build appengine js nacl tinygo wasm
|
||||
//go:build (appengine || js || nacl || tinygo || wasm || wasip1 || wasip2) && !windows
|
||||
// +build appengine js nacl tinygo wasm wasip1 wasip2
|
||||
// +build !windows
|
||||
|
||||
package isatty
|
||||
|
||||
+13
-2
@@ -31,6 +31,10 @@ func init() {
|
||||
if procGetFileInformationByHandleEx.Find() != nil {
|
||||
procGetFileInformationByHandleEx = nil
|
||||
}
|
||||
// Check if NtQueryObject is available.
|
||||
if procNtQueryObject.Find() != nil {
|
||||
procNtQueryObject = nil
|
||||
}
|
||||
}
|
||||
|
||||
// IsTerminal return true if the file descriptor is terminal.
|
||||
@@ -43,6 +47,7 @@ func IsTerminal(fd uintptr) bool {
|
||||
// Check pipe name is used for cygwin/msys2 pty.
|
||||
// Cygwin/MSYS2 PTY has a name like:
|
||||
// \{cygwin,msys}-XXXXXXXXXXXXXXXX-ptyN-{from,to}-master
|
||||
// On Windows 7 a trailing suffix (e.g. "-nat") may be appended.
|
||||
func isCygwinPipeName(name string) bool {
|
||||
token := strings.Split(name, "-")
|
||||
if len(token) < 5 {
|
||||
@@ -72,13 +77,19 @@ func isCygwinPipeName(name string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
for _, t := range token[5:] {
|
||||
if t == "" {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// getFileNameByHandle use the undocomented ntdll NtQueryObject to get file full name from file handler
|
||||
// getFileNameByHandle use the undocumented ntdll NtQueryObject to get file full name from file handler
|
||||
// since GetFileInformationByHandleEx is not available under windows Vista and still some old fashion
|
||||
// guys are using Windows XP, this is a workaround for those guys, it will also work on system from
|
||||
// Windows vista to 10
|
||||
// Windows Vista to 10
|
||||
// see https://stackoverflow.com/a/18792477 for details
|
||||
func getFileNameByHandle(fd uintptr) (string, error) {
|
||||
if procNtQueryObject == nil {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
FROM golang:1.26@sha256:68cb6d68bed024785b69195b89af7ac7a444f27791435f98647edff595aa0479
|
||||
FROM golang:1.25@sha256:31c1e53dfc1cc2d269deec9c83f58729fa3c53dc9a576f6426109d1e319e9e9a
|
||||
|
||||
ENV GOOS=linux
|
||||
ENV GOARCH=arm
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
FROM golang:1.26@sha256:68cb6d68bed024785b69195b89af7ac7a444f27791435f98647edff595aa0479
|
||||
FROM golang:1.25@sha256:31c1e53dfc1cc2d269deec9c83f58729fa3c53dc9a576f6426109d1e319e9e9a
|
||||
|
||||
ENV GOOS=linux
|
||||
ENV GOARCH=arm64
|
||||
|
||||
+89
-54
@@ -81,6 +81,8 @@ type config struct {
|
||||
colorCodes bool
|
||||
// custom colors to use for colorCodes
|
||||
customColors map[string]string
|
||||
// color to apply to spinner
|
||||
spinnerColorCode string
|
||||
|
||||
// show rate of change in kB/sec or MB/sec
|
||||
showBytes bool
|
||||
@@ -290,6 +292,13 @@ func OptionSetCustomColorCodes(customColors map[string]string) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// OptionSetSpinnerColorCode sets color code for spinner
|
||||
func OptionSetSpinnerColorCode(colorCode string) Option {
|
||||
return func(p *ProgressBar) {
|
||||
p.config.spinnerColorCode = colorCode
|
||||
}
|
||||
}
|
||||
|
||||
// OptionSetElapsedTime will enable elapsed time. Always enabled if OptionSetPredictTime is true.
|
||||
func OptionSetElapsedTime(elapsedTime bool) Option {
|
||||
return func(p *ProgressBar) {
|
||||
@@ -1114,6 +1123,74 @@ func getStringWidth(c config, str string) int {
|
||||
return stringWidth
|
||||
}
|
||||
|
||||
func renderDeterminateProgressBar(c config, s *state, bar, stats, leftBrac, rightBrac string) string {
|
||||
if rightBrac == "" {
|
||||
str := fmt.Sprintf("%4d%% %s %s",
|
||||
s.currentPercent,
|
||||
bar,
|
||||
stats)
|
||||
if (s.currentPercent == 100 && c.showElapsedTimeOnFinish) || c.elapsedTime {
|
||||
str = fmt.Sprintf("%s [%s]", str, leftBrac)
|
||||
}
|
||||
|
||||
if c.showDescriptionAtLineEnd {
|
||||
return fmt.Sprintf("\r%s %s ", str, c.description)
|
||||
}
|
||||
return fmt.Sprintf("\r%s%s ", c.description, str)
|
||||
}
|
||||
|
||||
if s.currentPercent == 100 {
|
||||
str := fmt.Sprintf("%4d%% %s %s",
|
||||
s.currentPercent,
|
||||
bar,
|
||||
stats)
|
||||
|
||||
if c.showElapsedTimeOnFinish {
|
||||
str = fmt.Sprintf("%s [%s]", str, leftBrac)
|
||||
}
|
||||
|
||||
if c.showDescriptionAtLineEnd {
|
||||
return fmt.Sprintf("\r%s %s", str, c.description)
|
||||
}
|
||||
return fmt.Sprintf("\r%s%s", c.description, str)
|
||||
}
|
||||
|
||||
str := fmt.Sprintf("%4d%% %s %s [%s:%s]",
|
||||
s.currentPercent,
|
||||
bar,
|
||||
stats,
|
||||
leftBrac,
|
||||
rightBrac)
|
||||
|
||||
if c.showDescriptionAtLineEnd {
|
||||
return fmt.Sprintf("\r%s %s", str, c.description)
|
||||
}
|
||||
return fmt.Sprintf("\r%s%s", c.description, str)
|
||||
}
|
||||
|
||||
func fitProgressBarWidth(c config, s *state, barStart, barEnd, stats, leftBrac, rightBrac string) int {
|
||||
if c.fullWidth || c.ignoreLength || c.width <= 0 {
|
||||
return c.width
|
||||
}
|
||||
|
||||
terminalWidth, err := termWidth(c.writer)
|
||||
if err != nil || terminalWidth <= 0 {
|
||||
return c.width
|
||||
}
|
||||
|
||||
bar := barStart + strings.Repeat(c.theme.SaucerPadding, c.width) + barEnd
|
||||
lineWidth := getStringWidth(c, renderDeterminateProgressBar(c, s, bar, stats, leftBrac, rightBrac))
|
||||
if lineWidth <= terminalWidth {
|
||||
return c.width
|
||||
}
|
||||
|
||||
fitWidth := c.width - (lineWidth - terminalWidth)
|
||||
if fitWidth < 0 {
|
||||
return 0
|
||||
}
|
||||
return fitWidth
|
||||
}
|
||||
|
||||
func renderProgressBar(c config, s *state) (int, error) {
|
||||
var sb strings.Builder
|
||||
|
||||
@@ -1243,6 +1320,10 @@ func renderProgressBar(c config, s *state) (int, error) {
|
||||
if (s.currentSaucerSize > 0 || s.currentPercent > 0) && c.theme.BarStartFilled != "" {
|
||||
barStart = c.theme.BarStartFilled
|
||||
}
|
||||
c.width = fitProgressBarWidth(c, s, barStart, barEnd, sb.String(), leftBrac, rightBrac)
|
||||
if !c.ignoreLength {
|
||||
s.currentSaucerSize = int(float64(s.currentPercent) / 100.0 * float64(c.width))
|
||||
}
|
||||
if s.currentSaucerSize > 0 {
|
||||
if c.ignoreLength {
|
||||
saucer = strings.Repeat(c.theme.SaucerPadding, s.currentSaucerSize-1)
|
||||
@@ -1294,6 +1375,10 @@ func renderProgressBar(c config, s *state) (int, error) {
|
||||
spinner = selectedSpinner[s.spinnerIdx]
|
||||
s.spinnerIdx = (s.spinnerIdx + 1) % len(selectedSpinner)
|
||||
}
|
||||
// if set add spinner color code
|
||||
if c.spinnerColorCode != "" && c.colorCodes {
|
||||
spinner = "[" + c.spinnerColorCode + "]" + spinner + "[reset]"
|
||||
}
|
||||
if c.elapsedTime {
|
||||
if c.showDescriptionAtLineEnd {
|
||||
str = fmt.Sprintf("\r%s %s [%s] %s ",
|
||||
@@ -1322,61 +1407,11 @@ func renderProgressBar(c config, s *state) (int, error) {
|
||||
}
|
||||
}
|
||||
} else if rightBrac == "" {
|
||||
str = fmt.Sprintf("%4d%% %s%s%s%s%s %s",
|
||||
s.currentPercent,
|
||||
barStart,
|
||||
saucer,
|
||||
saucerHead,
|
||||
strings.Repeat(c.theme.SaucerPadding, repeatAmount),
|
||||
barEnd,
|
||||
sb.String())
|
||||
if (s.currentPercent == 100 && c.showElapsedTimeOnFinish) || c.elapsedTime {
|
||||
str = fmt.Sprintf("%s [%s]", str, leftBrac)
|
||||
}
|
||||
|
||||
if c.showDescriptionAtLineEnd {
|
||||
str = fmt.Sprintf("\r%s %s ", str, c.description)
|
||||
} else {
|
||||
str = fmt.Sprintf("\r%s%s ", c.description, str)
|
||||
}
|
||||
bar := barStart + saucer + saucerHead + strings.Repeat(c.theme.SaucerPadding, repeatAmount) + barEnd
|
||||
str = renderDeterminateProgressBar(c, s, bar, sb.String(), leftBrac, rightBrac)
|
||||
} else {
|
||||
if s.currentPercent == 100 {
|
||||
str = fmt.Sprintf("%4d%% %s%s%s%s%s %s",
|
||||
s.currentPercent,
|
||||
barStart,
|
||||
saucer,
|
||||
saucerHead,
|
||||
strings.Repeat(c.theme.SaucerPadding, repeatAmount),
|
||||
barEnd,
|
||||
sb.String())
|
||||
|
||||
if c.showElapsedTimeOnFinish {
|
||||
str = fmt.Sprintf("%s [%s]", str, leftBrac)
|
||||
}
|
||||
|
||||
if c.showDescriptionAtLineEnd {
|
||||
str = fmt.Sprintf("\r%s %s", str, c.description)
|
||||
} else {
|
||||
str = fmt.Sprintf("\r%s%s", c.description, str)
|
||||
}
|
||||
} else {
|
||||
str = fmt.Sprintf("%4d%% %s%s%s%s%s %s [%s:%s]",
|
||||
s.currentPercent,
|
||||
barStart,
|
||||
saucer,
|
||||
saucerHead,
|
||||
strings.Repeat(c.theme.SaucerPadding, repeatAmount),
|
||||
barEnd,
|
||||
sb.String(),
|
||||
leftBrac,
|
||||
rightBrac)
|
||||
|
||||
if c.showDescriptionAtLineEnd {
|
||||
str = fmt.Sprintf("\r%s %s", str, c.description)
|
||||
} else {
|
||||
str = fmt.Sprintf("\r%s%s", c.description, str)
|
||||
}
|
||||
}
|
||||
bar := barStart + saucer + saucerHead + strings.Repeat(c.theme.SaucerPadding, repeatAmount) + barEnd
|
||||
str = renderDeterminateProgressBar(c, s, bar, sb.String(), leftBrac, rightBrac)
|
||||
}
|
||||
|
||||
if c.colorCodes {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# This is a renovate-friendly source of Docker images.
|
||||
FROM python:3.13.6-slim-bullseye@sha256:e98b521460ee75bca92175c16247bdf7275637a8faaeb2bcfa19d879ae5c4b9a AS python
|
||||
FROM otel/weaver:v0.24.2@sha256:d1fb16d279f39810c340fbbf1cf9e5e995a3a9cefa531938e9012437e3bc00c1 AS weaver
|
||||
FROM otel/weaver:v0.21.2@sha256:2401de985c38bdb98b43918e2f43aa36b2afed4aa5669ac1c1de0a17301cd36d AS weaver
|
||||
FROM avtodev/markdown-lint:v1@sha256:6aeedc2f49138ce7a1cd0adffc1b1c0321b841dc2102408967d9301c031949ee AS markdown
|
||||
|
||||
Vendored
+4
-4
@@ -419,8 +419,8 @@ github.com/lucasb-eyer/go-colorful
|
||||
# github.com/mattn/go-colorable v0.1.14
|
||||
## explicit; go 1.18
|
||||
github.com/mattn/go-colorable
|
||||
# github.com/mattn/go-isatty v0.0.20
|
||||
## explicit; go 1.15
|
||||
# github.com/mattn/go-isatty v0.0.22
|
||||
## explicit; go 1.21
|
||||
github.com/mattn/go-isatty
|
||||
# github.com/mattn/go-localereader v0.0.1
|
||||
## explicit
|
||||
@@ -530,8 +530,8 @@ github.com/rivo/uniseg
|
||||
# github.com/russross/blackfriday/v2 v2.1.0
|
||||
## explicit
|
||||
github.com/russross/blackfriday/v2
|
||||
# github.com/schollz/progressbar/v3 v3.19.0
|
||||
## explicit; go 1.22
|
||||
# github.com/schollz/progressbar/v3 v3.19.1
|
||||
## explicit; go 1.25.0
|
||||
github.com/schollz/progressbar/v3
|
||||
# github.com/sergi/go-diff v1.4.0
|
||||
## explicit; go 1.13
|
||||
|
||||
Reference in New Issue
Block a user