File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
completers/common/pixi_completer/cmd Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package cmd
33import (
44 "github.com/carapace-sh/carapace"
55 "github.com/spf13/cobra"
6+ "github.com/spf13/pflag"
67)
78
89var rootCmd = & cobra.Command {
@@ -30,4 +31,15 @@ func init() {
3031 carapace .Gen (rootCmd ).FlagCompletion (carapace.ActionMap {
3132 "color" : carapace .ActionValues ("always" , "never" , "auto" ),
3233 })
34+
35+ carapace .Gen (rootCmd ).PreInvoke (func (cmd * cobra.Command , flag * pflag.Flag , action carapace.Action ) carapace.Action {
36+ // TODO handle PIXI_PROJECT_ROOT
37+ if f := cmd .Flag ("manifest-path" ); f != nil && f .Changed {
38+ return carapace .ActionCallback (func (c carapace.Context ) carapace.Action {
39+ c .Setenv ("PIXI_PROJECT_MANIFEST" , f .Value .String ())
40+ return action .Invoke (c ).ToA ()
41+ })
42+ }
43+ return action
44+ })
3345}
You can’t perform that action at this time.
0 commit comments