Skip to content

Commit

Permalink
make: support directory change
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Aug 11, 2023
1 parent 35bbcde commit 048448c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions completers/make_completer/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/pkg/actions/tools/make"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)

var rootCmd = &cobra.Command{
Expand Down Expand Up @@ -85,4 +86,8 @@ func init() {
return make.ActionTargets(file).FilterArgs()
}),
)

carapace.Gen(rootCmd).PreInvoke(func(cmd *cobra.Command, flag *pflag.Flag, action carapace.Action) carapace.Action {
return action.Chdir(rootCmd.Flag("directory").Value.String())
})
}

0 comments on commit 048448c

Please sign in to comment.