Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Jan 13, 2024
1 parent f846e02 commit 5ee792b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
4 changes: 2 additions & 2 deletions pkg/actions/bridge/bash.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var bashSnippet string
func ActionBash(command ...string) carapace.Action {
return carapace.ActionCallback(func(c carapace.Context) carapace.Action {
if len(command) == 0 {
return carapace.ActionMessage("missing argument [ActionFish]")
return carapace.ActionMessage("missing argument [ActionBash]")
}

configDir, err := xdg.UserConfigDir()
Expand All @@ -44,7 +44,7 @@ func ActionBash(command ...string) carapace.Action {
return carapace.ActionMessage(err.Error())
}

c.Setenv("COMP_LINE", shlex.Join(args)) // TODO TODO other COMP_* variables
c.Setenv("COMP_LINE", shlex.Join(args)) // TODO other COMP_* variables
return carapace.ActionExecCommand("bash", "--rcfile", configPath, "-i", "-c", bashSnippet, strings.Join(args, " "))(func(output []byte) carapace.Action {
lines := strings.Split(string(output), "\n")
return carapace.ActionValues(lines[:len(lines)-1]...).StyleF(style.ForPath)
Expand Down
12 changes: 1 addition & 11 deletions pkg/actions/bridge/fish.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,8 @@ func ActionFish(command ...string) carapace.Action {
return carapace.ActionMessage(err.Error())
}

// TODO verify
// replacer := strings.NewReplacer(
// ` `, `\ `,
// `"`, `\""`,
// )

args := append(command, c.Args...)
// TODO verify
// args = append(args, c.Value)
// for index, arg := range args {
// args[index] = replacer.Replace(arg)
// }
args = append(command, c.Value)

configPath := fmt.Sprintf("%v/carapace/bridge/fish/config.fish", configDir)
if err := ensureExists(configPath); err != nil {
Expand Down

0 comments on commit 5ee792b

Please sign in to comment.