This commit introduces a non-interactive mode for the `collect` commands. When running in a non-interactive session, the progress bar is replaced with a series of thematic Borg quotes, printed in matrix-green text. The quotes are sourced from a `quotes.json` file, which is embedded into the binary using Go's `embed` package. The `pkg/ui` package now contains a `NonInteractivePrompter` that detects the session type and displays the quotes accordingly. The `collect` commands have been updated to use this new prompter, and the underlying `vcs` and `website` packages have been made more robust to handle cases where a progress bar is not provided. This commit also addresses feedback from the code review: - Fixes a formatting inconsistency in `data/quotes.json`. - Updates the `go-colorable` dependency to `v0.1.14`. - Adds a nil-check to the `Write` method in `pkg/ui/progress_writer.go` to prevent panics. - Implements caching for the quotes using `sync.Once` and adds checks for empty quote slices to prevent panics in `pkg/ui/quote.go`. - Refactors the `NonInteractivePrompter` in `pkg/ui/non_interactive_prompter.go` to be more robust and efficient.
47 lines
1.9 KiB
Modula-2
47 lines
1.9 KiB
Modula-2
module github.com/Snider/Borg
|
|
|
|
go 1.24.3
|
|
|
|
require (
|
|
github.com/go-git/go-git/v5 v5.16.3
|
|
github.com/google/go-github/v39 v39.2.0
|
|
github.com/schollz/progressbar/v3 v3.18.0
|
|
github.com/spf13/cobra v1.10.1
|
|
golang.org/x/mod v0.29.0
|
|
golang.org/x/net v0.46.0
|
|
golang.org/x/oauth2 v0.27.0
|
|
)
|
|
|
|
require (
|
|
dario.cat/mergo v1.0.0 // indirect
|
|
github.com/Microsoft/go-winio v0.6.2 // indirect
|
|
github.com/ProtonMail/go-crypto v1.1.6 // indirect
|
|
github.com/cloudflare/circl v1.6.1 // indirect
|
|
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
|
|
github.com/emirpasic/gods v1.18.1 // indirect
|
|
github.com/fatih/color v1.18.0 // indirect
|
|
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
|
|
github.com/go-git/go-billy/v5 v5.6.2 // indirect
|
|
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
|
|
github.com/golang/protobuf v1.5.4 // indirect
|
|
github.com/google/go-querystring v1.1.0 // indirect
|
|
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
|
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
|
|
github.com/kevinburke/ssh_config v1.2.0 // indirect
|
|
github.com/mattn/go-colorable v0.1.14 // indirect
|
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
|
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
|
|
github.com/pjbgf/sha1cd v0.3.2 // indirect
|
|
github.com/rivo/uniseg v0.4.7 // indirect
|
|
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
|
|
github.com/skeema/knownhosts v1.3.1 // indirect
|
|
github.com/spf13/pflag v1.0.10 // indirect
|
|
github.com/ulikunitz/xz v0.5.15 // indirect
|
|
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
|
golang.org/x/crypto v0.43.0 // indirect
|
|
golang.org/x/sys v0.37.0 // indirect
|
|
golang.org/x/term v0.36.0 // indirect
|
|
google.golang.org/appengine v1.6.7 // indirect
|
|
google.golang.org/protobuf v1.33.0 // indirect
|
|
gopkg.in/warnings.v0 v0.1.2 // indirect
|
|
)
|