File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import (
1515 "github.com/carapace-sh/carapace-bridge/pkg/actions/bridge"
1616 "github.com/carapace-sh/carapace-bridge/pkg/bridges"
1717 "github.com/carapace-sh/carapace/pkg/uid"
18+ "github.com/carapace-sh/carapace/third_party/golang.org/x/sys/execabs"
1819 "github.com/spf13/cobra"
1920)
2021
@@ -29,6 +30,13 @@ var invokeCmd = &cobra.Command{
2930 Short : "" ,
3031 Args : cobra .MinimumNArgs (1 ),
3132 Run : func (cmd * cobra.Command , args []string ) {
33+ if completer := args [0 ]; strings .Contains (completer , "/" ) {
34+ // patch to base if resolves to path executable (#2971)
35+ base := filepath .Base (completer )
36+ if abs , err := execabs .LookPath (base ); err == nil && args [0 ] == abs {
37+ args [0 ] = base
38+ }
39+ }
3240 // TODO newInvoke(cmd, args)
3341 oldInvoke (cmd , args )
3442 },
You can’t perform that action at this time.
0 commit comments