updated GHA
Some checks reported errors
continuous-integration/drone/pr Build encountered an error
continuous-integration/drone/push Build encountered an error

Update to v2 SDK
updated dependencies
This commit is contained in:
2022-08-06 16:21:18 +02:00
parent 989e7079a5
commit e1266ebf64
1909 changed files with 122367 additions and 279095 deletions

View File

@ -16,10 +16,7 @@ type fish struct {
func (f fish) Install(cmd, bin string) error {
completionFile := filepath.Join(f.configDir, "completions", fmt.Sprintf("%s.fish", cmd))
completeCmd, err := f.cmd(cmd, bin)
if err != nil {
return err
}
completeCmd := f.cmd(cmd, bin)
if _, err := os.Stat(completionFile); err == nil {
return fmt.Errorf("already installed at %s", completionFile)
}
@ -36,10 +33,10 @@ func (f fish) Uninstall(cmd, bin string) error {
return os.Remove(completionFile)
}
func (f fish) cmd(cmd, bin string) (string, error) {
func (f fish) cmd(cmd, bin string) string {
var buf bytes.Buffer
params := struct{ Cmd, Bin string }{cmd, bin}
tmpl := template.Must(template.New("cmd").Parse(`
template.Must(template.New("cmd").Parse(`
function __complete_{{.Cmd}}
set -lx COMP_LINE (string join ' ' (commandline -o))
test (commandline -ct) = ""
@ -47,10 +44,7 @@ function __complete_{{.Cmd}}
{{.Bin}}
end
complete -c {{.Cmd}} -a "(__complete_{{.Cmd}})"
`))
err := tmpl.Execute(&buf, params)
if err != nil {
return "", err
}
return buf.String(), nil
`)).Execute(&buf, params)
return string(buf.Bytes())
}

View File

@ -51,7 +51,7 @@ func Uninstall(cmd string) error {
for _, i := range is {
errI := i.Uninstall(cmd, bin)
if errI != nil {
err = multierror.Append(err, errI)
multierror.Append(err, errI)
}
}

View File

@ -115,10 +115,7 @@ func removeContentToTempFile(name, content string) (string, error) {
if str == content {
continue
}
_, err = wf.WriteString(str + "\n")
if err != nil {
return "", err
}
wf.WriteString(str + "\n")
prefix = prefix[:0]
}
return wf.Name(), nil