Skip to content

Commit

Permalink
fix(autocomplete): remove extra var
Browse files Browse the repository at this point in the history
  • Loading branch information
Laure-di committed May 27, 2024
1 parent ee47af4 commit d3885dd
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions internal/namespaces/autocomplete/autocomplete.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ type autocompleteScript struct {
// autocompleteScripts regroups the autocomplete scripts for the different shells
// The key is the path of the shell.
func autocompleteScripts(ctx context.Context, basename string) map[string]autocompleteScript {
binaryName := basename
homePath := core.ExtractUserHomeDir(ctx)
return map[string]autocompleteScript{
"bash": {
Expand All @@ -78,7 +77,7 @@ func autocompleteScripts(ctx context.Context, basename string) map[string]autoco
return
}
complete -F _%[1]s %[1]s
`, binaryName),
`, basename),
CompleteScript: fmt.Sprintf(`eval "$(%s autocomplete script shell=bash)"`, binaryName),

Check failure on line 81 in internal/namespaces/autocomplete/autocomplete.go

View workflow job for this annotation

GitHub Actions / build

undefined: binaryName

Check failure on line 81 in internal/namespaces/autocomplete/autocomplete.go

View workflow job for this annotation

GitHub Actions / build-and-test (1.22.x, ubuntu-latest)

undefined: binaryName

Check failure on line 81 in internal/namespaces/autocomplete/autocomplete.go

View workflow job for this annotation

GitHub Actions / build-and-test (1.22.x, ubuntu-latest)

undefined: binaryName

Check failure on line 81 in internal/namespaces/autocomplete/autocomplete.go

View workflow job for this annotation

GitHub Actions / build-tests (1.22.x, ubuntu-latest)

undefined: binaryName

Check failure on line 81 in internal/namespaces/autocomplete/autocomplete.go

View workflow job for this annotation

GitHub Actions / build-tests (1.22.x, ubuntu-latest)

undefined: binaryName

Check failure on line 81 in internal/namespaces/autocomplete/autocomplete.go

View workflow job for this annotation

GitHub Actions / build-tests (1.22.x, ubuntu-latest)

undefined: binaryName

Check failure on line 81 in internal/namespaces/autocomplete/autocomplete.go

View workflow job for this annotation

GitHub Actions / build-tests (1.22.x, ubuntu-latest)

undefined: binaryName

Check failure on line 81 in internal/namespaces/autocomplete/autocomplete.go

View workflow job for this annotation

GitHub Actions / build-tests (1.22.x, ubuntu-latest)

undefined: binaryName

Check failure on line 81 in internal/namespaces/autocomplete/autocomplete.go

View workflow job for this annotation

GitHub Actions / build-tests (1.22.x, ubuntu-latest)

undefined: binaryName

Check failure on line 81 in internal/namespaces/autocomplete/autocomplete.go

View workflow job for this annotation

GitHub Actions / build-tests (1.22.x, ubuntu-latest)

undefined: binaryName

Check failure on line 81 in internal/namespaces/autocomplete/autocomplete.go

View workflow job for this annotation

GitHub Actions / os-tests (1.22.x, ubuntu-latest)

undefined: binaryName

Check failure on line 81 in internal/namespaces/autocomplete/autocomplete.go

View workflow job for this annotation

GitHub Actions / os-tests (1.22.x, macos-latest)

undefined: binaryName

Check failure on line 81 in internal/namespaces/autocomplete/autocomplete.go

View workflow job for this annotation

GitHub Actions / os-tests (1.22.x, windows-latest)

undefined: binaryName
ShellConfigurationFile: map[string]string{
"darwin": path.Join(homePath, ".bash_profile"),
Expand All @@ -102,8 +101,8 @@ func autocompleteScripts(ctx context.Context, basename string) map[string]autoco
complete --erase --command %[1]s;
complete --command %[1]s --no-files;
complete --command %[1]s --arguments '(%[1]s autocomplete complete fish -- (commandline) (commandline --cursor) (commandline --current-token) (commandline --current-process --tokenize --cut-at-cursor))';
`, binaryName),
CompleteScript: fmt.Sprintf(`eval (%s autocomplete script shell=fish)`, binaryName),
`, basename),
CompleteScript: fmt.Sprintf(`eval (%s autocomplete script shell=fish)`, basename),
ShellConfigurationFile: map[string]string{
"darwin": path.Join(homePath, ".config/fish/config.fish"),
"linux": path.Join(homePath, ".config/fish/config.fish"),
Expand All @@ -124,8 +123,8 @@ func autocompleteScripts(ctx context.Context, basename string) map[string]autoco
compadd "${opts[@]}" -- "${output[@]}"
}
compdef _%[1]s %[1]s
`, binaryName),
CompleteScript: fmt.Sprintf(`eval "$(%s autocomplete script shell=zsh)"`, binaryName),
`, basename),
CompleteScript: fmt.Sprintf(`eval "$(%s autocomplete script shell=zsh)"`, basename),
ShellConfigurationFile: map[string]string{
"darwin": path.Join(homePath, ".zshrc"),
"linux": path.Join(homePath, ".zshrc"),
Expand Down

0 comments on commit d3885dd

Please sign in to comment.