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

Function ensureGlobalEnvEnabled

internal/boxcli/global.go:93–125  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

91}
92
93func ensureGlobalEnvEnabled(cmd *cobra.Command, args []string) error {
94 if cmd.Name() == "shellenv" {
95 return nil
96 }
97 path, err := ensureGlobalConfig()
98 if err != nil {
99 return errors.WithStack(err)
100 }
101
102 box, err := devbox.Open(&devopt.Opts{
103 Dir: path,
104 Stderr: cmd.ErrOrStderr(),
105 })
106 if err != nil {
107 return err
108 }
109 if !box.IsEnvEnabled() {
110 fmt.Fprintln(cmd.ErrOrStderr())
111 ux.Fwarningf(
112 cmd.ErrOrStderr(),
113 `devbox global is not activated.
114
115Add the following line to your shell's rcfile and restart your shell:
116
117For bash/zsh (~/.bashrc or ~/.zshrc):
118 eval "$(devbox global shellenv)"
119
120For nushell: See NUSHELL.md for setup instructions
121`,
122 )
123 }
124 return nil
125}

Callers

nothing calls this directly

Calls 4

OpenFunction · 0.92
FwarningfFunction · 0.92
ensureGlobalConfigFunction · 0.85
IsEnvEnabledMethod · 0.80

Tested by

no test coverage detected