Skip to content

Commit

Permalink
nix: fix package query
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Nov 8, 2022
1 parent 8093786 commit 4463881
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/actions/tools/nix/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func ActionPackages(channel string) carapace.Action {
return carapace.ActionMessage("search needs at least 1 character")
}

query := fmt.Sprintf(`SELECT name FROM Programs WHERE name LIKE "%v%%"`, c.CallbackValue)
query := fmt.Sprintf(`SELECT DISTINCT package FROM Programs WHERE package LIKE "%v%%"`, c.CallbackValue) // TODO filter by system (architecture)
return carapace.ActionExecCommand("sqlite3", path, query)(func(output []byte) carapace.Action {
lines := strings.Split(string(output), "\n")
return carapace.ActionValues(lines[:len(lines)-1]...)
Expand Down

0 comments on commit 4463881

Please sign in to comment.