MCPcopy Index your code
hub / github.com/jetify-com/devbox / setGlobalConfigForDelegatedCommands

Function setGlobalConfigForDelegatedCommands

internal/boxcli/global.go:73–91  ·  view source on GitHub ↗
(
	globalCmd *cobra.Command,
)

Source from the content-addressed store, hash-verified

71}
72
73func setGlobalConfigForDelegatedCommands(
74 globalCmd *cobra.Command,
75) func(cmd *cobra.Command, args []string) error {
76 return func(cmd *cobra.Command, args []string) error {
77 globalPath, err := ensureGlobalConfig()
78 if err != nil {
79 return err
80 }
81
82 for _, c := range globalCmd.Commands() {
83 if f := c.Flag("config"); f != nil && f.Value.Type() == "string" {
84 if err := f.Value.Set(globalPath); err != nil {
85 return errors.WithStack(err)
86 }
87 }
88 }
89 return nil
90 }
91}
92
93func ensureGlobalEnvEnabled(cmd *cobra.Command, args []string) error {
94 if cmd.Name() == "shellenv" {

Callers 1

globalCmdFunction · 0.85

Calls 2

ensureGlobalConfigFunction · 0.85
TypeMethod · 0.80

Tested by

no test coverage detected