Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Jan 15, 2024
1 parent 4ab036e commit 6054279
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
17 changes: 14 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
FROM ghcr.io/rsteube/carapace:latest

RUN apt-get update && apt-get install -y npm

# cobra
RUN curl -Lo /usr/local/bin/minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \
&& chmod +x /usr/local/bin/minikube

RUN apt-get update && apt-get install -y npm
# complete
RUN curl --proto '=https' --tlsv1.2 -fsSL https://get.opentofu.org/install-opentofu.sh | sh -s -- --install-method deb

# inshellisense
RUN npm install -g @microsoft/inshellisense
RUN cd /usr/local/lib/node_modules/@microsoft/inshellisense/ \
&& npm i @withfig/[email protected]

RUN curl --proto '=https' --tlsv1.2 -fsSL https://get.opentofu.org/install-opentofu.sh | sh -s -- --install-method deb

# kingpin
RUN curl https://goteleport.com/static/install.sh | bash -s 14.3.3

# urvavecli
RUN curl -Lo /usr/local/bin/minikube https://dl.gitea.com/tea/0.9.2/tea-0.9.2-linux-amd64 \
&& chmod +x /usr/local/bin/minikube

# yargs
RUN npm install -g @angular/cli
11 changes: 1 addition & 10 deletions pkg/actions/bridge/bash.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,9 @@ func ActionBash(command ...string) carapace.Action {
return carapace.ActionMessage(err.Error())
}

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

args := append(command, c.Args...)
args = append(args, c.Value)

// for index, arg := range args {
// args[index] = replacer.Replace(arg)
// }

configPath := fmt.Sprintf("%v/carapace/bridge/bash/.bashrc", configDir)
if err := ensureExists(configPath); err != nil {
return carapace.ActionMessage(err.Error())
Expand All @@ -48,6 +39,6 @@ func ActionBash(command ...string) carapace.Action {
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)
}).Invoke(c).ToA().NoSpace([]rune("/=@:.,")...) // TODO check compopt for nospace
}).NoSpace([]rune("/=@:.,")...) // TODO check compopt for nospace
})
}
4 changes: 2 additions & 2 deletions pkg/actions/bridge/bash.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -i
set -e
set -o pipefail
# set -e
# set -o pipefail

# COMP_LINE="$1"
COMP_WORDS=($COMP_LINE)
Expand Down
4 changes: 2 additions & 2 deletions pkg/actions/bridge/fish.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ func ActionFish(command ...string) carapace.Action {
}

args := append(command, c.Args...)
args = append(command, c.Value)
args = append(args, c.Value)

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

snippet := fmt.Sprintf(`source %#v;complete --do-complete="%v"`, configPath, shlex.Join(args)) // TODO needs custom escaping
snippet := fmt.Sprintf(`source /usr/share/fish/config.fish;source %#v;complete --do-complete="%v"`, configPath, shlex.Join(args)) // TODO needs custom escaping
return carapace.ActionExecCommand("fish", "--no-config", "--command", snippet)(func(output []byte) carapace.Action {
lines := strings.Split(string(output), "\n")

Expand Down

0 comments on commit 6054279

Please sign in to comment.