Update dependencies (#316)
update xdg update survey update go-sdk Co-authored-by: Norwin Roosen <git@nroo.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/316 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: 6543 <6543@obermui.de> Co-Authored-By: Norwin <noerw@noreply.gitea.io> Co-Committed-By: Norwin <noerw@noreply.gitea.io>
This commit is contained in:
2
vendor/github.com/AlecAivazis/survey/v2/go.mod
generated
vendored
2
vendor/github.com/AlecAivazis/survey/v2/go.mod
generated
vendored
@@ -5,7 +5,7 @@ require (
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
|
||||
github.com/kr/pty v1.1.4 // indirect
|
||||
github.com/kr/pty v1.1.4
|
||||
github.com/mattn/go-colorable v0.1.2 // indirect
|
||||
github.com/mattn/go-isatty v0.0.8
|
||||
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b
|
||||
|
||||
9
vendor/github.com/AlecAivazis/survey/v2/input.go
generated
vendored
9
vendor/github.com/AlecAivazis/survey/v2/input.go
generated
vendored
@@ -190,13 +190,20 @@ func (i *Input) Prompt(config *PromptConfig) (interface{}, error) {
|
||||
}
|
||||
|
||||
func (i *Input) Cleanup(config *PromptConfig, val interface{}) error {
|
||||
// use the default answer when cleaning up the prompt if necessary
|
||||
ans := i.answer
|
||||
if ans == "" && i.Default != "" {
|
||||
ans = i.Default
|
||||
}
|
||||
|
||||
// render the cleanup
|
||||
return i.Render(
|
||||
InputQuestionTemplate,
|
||||
InputTemplateData{
|
||||
Input: *i,
|
||||
ShowAnswer: true,
|
||||
Config: config,
|
||||
Answer: i.answer,
|
||||
Answer: ans,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
5
vendor/github.com/AlecAivazis/survey/v2/multiselect.go
generated
vendored
5
vendor/github.com/AlecAivazis/survey/v2/multiselect.go
generated
vendored
@@ -273,7 +273,10 @@ func (m *MultiSelect) Prompt(config *PromptConfig) (interface{}, error) {
|
||||
|
||||
// start waiting for input
|
||||
for {
|
||||
r, _, _ := rr.ReadRune()
|
||||
r, _, err := rr.ReadRune()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if r == '\r' || r == '\n' {
|
||||
break
|
||||
}
|
||||
|
||||
11
vendor/github.com/AlecAivazis/survey/v2/renderer.go
generated
vendored
11
vendor/github.com/AlecAivazis/survey/v2/renderer.go
generated
vendored
@@ -148,8 +148,15 @@ func (r *Renderer) countLines(buf bytes.Buffer) int {
|
||||
delim = len(bufBytes) // no new line found, read rest of text
|
||||
}
|
||||
|
||||
// account for word wrapping
|
||||
count += int(utf8.RuneCount(bufBytes[curr:delim]) / w)
|
||||
if lineWidth := utf8.RuneCount(bufBytes[curr:delim]); lineWidth > w {
|
||||
// account for word wrapping
|
||||
count += lineWidth / w
|
||||
if (lineWidth % w) == 0 {
|
||||
// content whose width is exactly a multiplier of available width should not
|
||||
// count as having wrapped on the last line
|
||||
count -= 1
|
||||
}
|
||||
}
|
||||
curr = delim + 1
|
||||
}
|
||||
|
||||
|
||||
4
vendor/github.com/AlecAivazis/survey/v2/terminal/cursor.go
generated
vendored
4
vendor/github.com/AlecAivazis/survey/v2/terminal/cursor.go
generated
vendored
@@ -42,12 +42,12 @@ func (c *Cursor) Back(n int) {
|
||||
|
||||
// NextLine moves cursor to beginning of the line n lines down.
|
||||
func (c *Cursor) NextLine(n int) {
|
||||
fmt.Fprintf(c.Out, "\x1b[%dE", n)
|
||||
c.Down(1)
|
||||
}
|
||||
|
||||
// PreviousLine moves cursor to beginning of the line n lines up.
|
||||
func (c *Cursor) PreviousLine(n int) {
|
||||
fmt.Fprintf(c.Out, "\x1b[%dF", n)
|
||||
c.Up(1)
|
||||
}
|
||||
|
||||
// HorizontalAbsolute moves cursor horizontally to x.
|
||||
|
||||
33
vendor/github.com/adrg/xdg/README.md
generated
vendored
33
vendor/github.com/adrg/xdg/README.md
generated
vendored
@@ -2,18 +2,22 @@ xdg
|
||||
===
|
||||
|
||||
[](https://github.com/adrg/xdg/actions?query=workflow%3ACI)
|
||||
[](https://codecov.io/gh/adrg/xdg)
|
||||
[](https://pkg.go.dev/github.com/adrg/xdg)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://goreportcard.com/report/github.com/adrg/xdg)
|
||||
[](https://github.com/adrg/xdg/issues)
|
||||
[](https://www.buymeacoffee.com/adrg)
|
||||
[](https://github.com/adrg/xdg/stargazers)
|
||||
|
||||
Provides an implementation of the [XDG Base Directory Specification](https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html).
|
||||
Provides an implementation of the [XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html).
|
||||
The specification defines a set of standard paths for storing application files,
|
||||
including data and configuration files. For portability and flexibility reasons,
|
||||
applications should use the XDG defined locations instead of hardcoding paths.
|
||||
The package also includes the locations of well known user directories.
|
||||
The package also includes the locations of well known [user directories](https://wiki.archlinux.org/index.php/XDG_user_directories).
|
||||
The current implementation supports Windows, Mac OS and most flavors of Unix.
|
||||
|
||||
Full documentation can be found at: https://godoc.org/github.com/adrg/xdg
|
||||
Full documentation can be found at: https://pkg.go.dev/github.com/adrg/xdg.
|
||||
|
||||
## Installation
|
||||
go get github.com/adrg/xdg
|
||||
@@ -103,7 +107,7 @@ import (
|
||||
|
||||
func main() {
|
||||
// XDG Base Directory paths.
|
||||
log.Println("Home config directory:", xdg.DataHome)
|
||||
log.Println("Home data directory:", xdg.DataHome)
|
||||
log.Println("Data directories:", xdg.DataDirs)
|
||||
log.Println("Home config directory:", xdg.ConfigHome)
|
||||
log.Println("Config directories:", xdg.ConfigDirs)
|
||||
@@ -117,7 +121,7 @@ func main() {
|
||||
// Obtain a suitable location for application config files.
|
||||
// ConfigFile takes one parameter which must contain the name of the file,
|
||||
// but it can also contain a set of parent directories. If the directories
|
||||
// don't exists, they will be created relative to the base config directory.
|
||||
// don't exist, they will be created relative to the base config directory.
|
||||
configFilePath, err := xdg.ConfigFile("appname/config.yaml")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
@@ -180,11 +184,24 @@ Contributions in the form of pull requests, issues or just general feedback,
|
||||
are always welcome.
|
||||
See [CONTRIBUTING.MD](https://github.com/adrg/xdg/blob/master/CONTRIBUTING.md).
|
||||
|
||||
**Contributors**:
|
||||
[adrg](https://github.com/adrg),
|
||||
[wichert](https://github.com/wichert),
|
||||
[bouncepaw](https://github.com/bouncepaw),
|
||||
[gabriel-vasile](https://github.com/gabriel-vasile).
|
||||
|
||||
## References
|
||||
|
||||
For more information see the
|
||||
[XDG Base Directory Specification](https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) and
|
||||
[XDG user directories](https://wiki.archlinux.org/index.php/XDG_user_directories).
|
||||
For more information see:
|
||||
* [XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html)
|
||||
* [XDG user directories](https://wiki.archlinux.org/index.php/XDG_user_directories)
|
||||
|
||||
## Buy me a coffee
|
||||
|
||||
If you found this project useful and want to support it, consider buying me a coffee.
|
||||
<a href="https://www.buymeacoffee.com/adrg">
|
||||
<img src="https://cdn.buymeacoffee.com/buttons/v2/arial-orange.png" alt="Buy Me A Coffee" height="42px">
|
||||
</a>
|
||||
|
||||
## License
|
||||
|
||||
|
||||
4
vendor/github.com/adrg/xdg/base_dirs.go
generated
vendored
4
vendor/github.com/adrg/xdg/base_dirs.go
generated
vendored
@@ -3,7 +3,7 @@ package xdg
|
||||
import "os"
|
||||
|
||||
// XDG Base Directory environment variables.
|
||||
var (
|
||||
const (
|
||||
envDataHome = "XDG_DATA_HOME"
|
||||
envDataDirs = "XDG_DATA_DIRS"
|
||||
envConfigHome = "XDG_CONFIG_HOME"
|
||||
@@ -48,7 +48,7 @@ func (bd baseDirectories) runtimeFile(relPath string) (string, error) {
|
||||
|
||||
if fi.IsDir() {
|
||||
// The runtime directory must be owned by the user.
|
||||
if err = os.Chown(bd.runtime, os.Getuid(), os.Getgid()); err != nil {
|
||||
if err = chown(bd.runtime, os.Getuid(), os.Getgid()); err != nil {
|
||||
return "", err
|
||||
}
|
||||
} else {
|
||||
|
||||
2
vendor/github.com/adrg/xdg/user_dirs.go
generated
vendored
2
vendor/github.com/adrg/xdg/user_dirs.go
generated
vendored
@@ -1,7 +1,7 @@
|
||||
package xdg
|
||||
|
||||
// XDG user directories environment variables.
|
||||
var (
|
||||
const (
|
||||
envDesktopDir = "XDG_DESKTOP_DIR"
|
||||
envDownloadDir = "XDG_DOWNLOAD_DIR"
|
||||
envDocumentsDir = "XDG_DOCUMENTS_DIR"
|
||||
|
||||
8
vendor/github.com/adrg/xdg/utils.go
generated
vendored
8
vendor/github.com/adrg/xdg/utils.go
generated
vendored
@@ -33,6 +33,14 @@ func homeDir() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func chown(name string, uid, gid int) error {
|
||||
if goOS := runtime.GOOS; goOS == "windows" || goOS == "plan9" {
|
||||
return nil
|
||||
}
|
||||
|
||||
return os.Chown(name, uid, gid)
|
||||
}
|
||||
|
||||
func exists(path string) bool {
|
||||
_, err := os.Stat(path)
|
||||
return err == nil || os.IsExist(err)
|
||||
|
||||
Reference in New Issue
Block a user