diff --git a/CHANGELOG.md b/CHANGELOG.md index 454dcd1be..600ee9692 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### To be Released * feat(logs): allow to filter logs to only show router logs [#707](https://github.com/Scalingo/cli/pull/707) +* build(deps): bump github.com/briandowns/spinner from 1.16.0 to 1.18.0 ### 1.22.0 diff --git a/go.mod b/go.mod index 74f60e346..936617ac5 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/Scalingo/go-utils/errors v1.1.0 github.com/Scalingo/go-utils/retry v1.1.0 github.com/andrew-d/go-termutil v0.0.0-20150726205930-009166a695a2 - github.com/briandowns/spinner v1.16.0 + github.com/briandowns/spinner v1.18.0 github.com/cheggaaa/pb v1.0.29 github.com/dustin/go-humanize v1.0.0 github.com/fatih/color v1.13.0 diff --git a/go.sum b/go.sum index e8f74dfa3..db86b613b 100644 --- a/go.sum +++ b/go.sum @@ -23,8 +23,8 @@ github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/briandowns/spinner v1.16.0 h1:DFmp6hEaIx2QXXuqSJmtfSBSAjRmpGiKG6ip2Wm/yOs= -github.com/briandowns/spinner v1.16.0/go.mod h1:QOuQk7x+EaDASo80FEXwlwiA+j/PPIcX3FScO+3/ZPQ= +github.com/briandowns/spinner v1.18.0 h1:SJs0maNOs4FqhBwiJ3Gr7Z1D39/rukIVGQvpNZVHVcM= +github.com/briandowns/spinner v1.18.0/go.mod h1:QOuQk7x+EaDASo80FEXwlwiA+j/PPIcX3FScO+3/ZPQ= github.com/cheggaaa/pb v1.0.29 h1:FckUN5ngEk2LpvuG0fw1GEFx6LtyY2pWI/Z2QgCnEYo= github.com/cheggaaa/pb v1.0.29/go.mod h1:W40334L7FMC5JKWldsTWbdGjLo0RxUKK73K+TuPxX30= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= diff --git a/vendor/github.com/briandowns/spinner/.travis.yml b/vendor/github.com/briandowns/spinner/.travis.yml index 5a00f590c..74d205aec 100644 --- a/vendor/github.com/briandowns/spinner/.travis.yml +++ b/vendor/github.com/briandowns/spinner/.travis.yml @@ -3,8 +3,8 @@ arch: - ppc64le language: go go: - - 1.13 - - 1.14.1 + - 1.16 + - 1.17.5 env: - GOARCH: amd64 - GOARCH: 386 diff --git a/vendor/github.com/briandowns/spinner/Makefile b/vendor/github.com/briandowns/spinner/Makefile index bf0b48ae0..3cfdeb23c 100644 --- a/vendor/github.com/briandowns/spinner/Makefile +++ b/vendor/github.com/briandowns/spinner/Makefile @@ -1,9 +1,11 @@ -GO = GO111MODULE=on GOFLAGS=-mod=vendor go +GO = go .PHONY: deps -deps: - $(GO) mod download - $(GO) mod vendor +deps: go.mod + +go.mod: + go mod init + go mod tidy .PHONY: test test: diff --git a/vendor/github.com/briandowns/spinner/NOTICE.txt b/vendor/github.com/briandowns/spinner/NOTICE.txt new file mode 100644 index 000000000..e72228e94 --- /dev/null +++ b/vendor/github.com/briandowns/spinner/NOTICE.txt @@ -0,0 +1,4 @@ +Spinner +Copyright (c) 2021 Brian J. Downs +This product is licensed to you under the Apache 2.0 license (the "License"). You may not use this product except in compliance with the Apache 2.0 License. +This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. diff --git a/vendor/github.com/briandowns/spinner/README.md b/vendor/github.com/briandowns/spinner/README.md index ddae178b6..20b315fbe 100644 --- a/vendor/github.com/briandowns/spinner/README.md +++ b/vendor/github.com/briandowns/spinner/README.md @@ -15,6 +15,9 @@ go get github.com/briandowns/spinner ``` ## Available Character Sets + +90 Character Sets. Some examples below: + (Numbered by their slice index) | index | character set | sample gif | @@ -151,7 +154,7 @@ You can specify both the background and foreground color, as well as additional s.Color("red", "bold") // Set the spinner color to a bold red ``` -Or to set the background to black, the foreground to a bold red: +To set the background to black, the foreground to a bold red: ```Go s.Color("bgBlack", "bold", "fgRed") @@ -159,7 +162,7 @@ s.Color("bgBlack", "bold", "fgRed") Below is the full color and attribute list: -``` +```Go // default colors red black diff --git a/vendor/github.com/briandowns/spinner/character_sets.go b/vendor/github.com/briandowns/spinner/character_sets.go index f0d74a8fd..9c8a98b7e 100644 --- a/vendor/github.com/briandowns/spinner/character_sets.go +++ b/vendor/github.com/briandowns/spinner/character_sets.go @@ -1,3 +1,17 @@ +// Copyright (c) 2021 Brian J. Downs +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package spinner const ( @@ -25,6 +39,7 @@ var CharSets = map[int][]string{ 15: {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}, 16: {"▉", "▊", "▋", "▌", "▍", "▎", "▏", "▎", "▍", "▌", "▋", "▊", "▉"}, 17: {"■", "□", "▪", "▫"}, + 18: {"←", "↑", "→", "↓"}, 19: {"╫", "╪"}, 20: {"⇐", "⇖", "⇑", "⇗", "⇒", "⇘", "⇓", "⇙"}, @@ -86,6 +101,16 @@ var CharSets = map[int][]string{ 78: {"⠈⠁", "⠈⠑", "⠈⠱", "⠈⡱", "⢀⡱", "⢄⡱", "⢄⡱", "⢆⡱", "⢎⡱", "⢎⡰", "⢎⡠", "⢎⡀", "⢎⠁", "⠎⠁", "⠊⠁"}, 79: {"________", "-_______", "_-______", "__-_____", "___-____", "____-___", "_____-__", "______-_", "_______-", "________", "_______-", "______-_", "_____-__", "____-___", "___-____", "__-_____", "_-______", "-_______", "________"}, 80: {"|_______", "_/______", "__-_____", "___\\____", "____|___", "_____/__", "______-_", "_______\\", "_______|", "______\\_", "_____-__", "____/___", "___|____", "__\\_____", "_-______"}, + 81: {"□", "◱", "◧", "▣", "■"}, + 82: {"□", "◱", "▨", "▩", "■"}, + 83: {"░", "▒", "▓", "█"}, + 84: {"░", "█"}, + 85: {"⚪", "⚫"}, + 86: {"◯", "⬤"}, + 87: {"▱", "▰"}, + 88: {"➊", "➋", "➌", "➍", "➎", "➏", "➐", "➑", "➒", "➓"}, + 89: {"½", "⅓", "⅔", "¼", "¾", "⅛", "⅜", "⅝", "⅞"}, + 90: {"↞", "↟", "↠", "↡"}, } func init() { diff --git a/vendor/github.com/briandowns/spinner/spinner.go b/vendor/github.com/briandowns/spinner/spinner.go index 3462819df..7fc56f42f 100644 --- a/vendor/github.com/briandowns/spinner/spinner.go +++ b/vendor/github.com/briandowns/spinner/spinner.go @@ -1,3 +1,5 @@ +// Copyright (c) 2021 Brian J. Downs +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -171,7 +173,7 @@ func validColor(c string) bool { // Spinner struct to hold the provided options. type Spinner struct { - mu *sync.RWMutex // + mu *sync.RWMutex Delay time.Duration // Delay is the speed of the indicator chars []string // chars holds the chosen character set Prefix string // Prefix is the text preppended to the indicator @@ -202,6 +204,7 @@ func New(cs []string, d time.Duration, options ...Option) *Spinner { for _, option := range options { option(s) } + return s } @@ -301,14 +304,14 @@ func (s *Spinner) Start() { var outColor string if runtime.GOOS == "windows" { if s.Writer == os.Stderr { - outColor = fmt.Sprintf("\r%s%s%s ", s.Prefix, s.chars[i], s.Suffix) + outColor = fmt.Sprintf("\r%s%s%s", s.Prefix, s.chars[i], s.Suffix) } else { - outColor = fmt.Sprintf("\r%s%s%s ", s.Prefix, s.color(s.chars[i]), s.Suffix) + outColor = fmt.Sprintf("\r%s%s%s", s.Prefix, s.color(s.chars[i]), s.Suffix) } } else { - outColor = fmt.Sprintf("\r%s%s%s ", s.Prefix, s.color(s.chars[i]), s.Suffix) + outColor = fmt.Sprintf("\r%s%s%s", s.Prefix, s.color(s.chars[i]), s.Suffix) } - outPlain := fmt.Sprintf("\r%s%s%s ", s.Prefix, s.chars[i], s.Suffix) + outPlain := fmt.Sprintf("\r%s%s%s", s.Prefix, s.chars[i], s.Suffix) fmt.Fprint(s.Writer, outColor) s.lastOutput = outPlain delay := s.Delay @@ -395,7 +398,7 @@ func (s *Spinner) UpdateCharSet(cs []string) { s.mu.Unlock() } -// erase deletes written characters. +// erase deletes written characters on the current line. // Caller must already hold s.lock. func (s *Spinner) erase() { n := utf8.RuneCountInString(s.lastOutput) @@ -405,7 +408,14 @@ func (s *Spinner) erase() { s.lastOutput = "" return } - fmt.Fprintf(s.Writer, "\033[K") // erases to end of line + + // Taken from https://en.wikipedia.org/wiki/ANSI_escape_code: + // \r - Carriage return - Moves the cursor to column zero + // \033[K - Erases part of the line. If n is 0 (or missing), clear from + // cursor to the end of the line. If n is 1, clear from cursor to beginning + // of the line. If n is 2, clear entire line. Cursor position does not + // change. + fmt.Fprintf(s.Writer, "\r\033[K") s.lastOutput = "" } diff --git a/vendor/modules.txt b/vendor/modules.txt index 375b90516..e230be360 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -40,7 +40,7 @@ github.com/acomagu/bufpipe # github.com/andrew-d/go-termutil v0.0.0-20150726205930-009166a695a2 ## explicit github.com/andrew-d/go-termutil -# github.com/briandowns/spinner v1.16.0 +# github.com/briandowns/spinner v1.18.0 ## explicit github.com/briandowns/spinner # github.com/cheggaaa/pb v1.0.29