File tree Expand file tree Collapse file tree 3 files changed +20
-8
lines changed Expand file tree Collapse file tree 3 files changed +20
-8
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import (
13
13
14
14
"github.com/fatih/color"
15
15
"github.com/pkg/errors"
16
- "go.jetpack.io/devbox/internal/boxcli/featureflag"
17
16
"go.jetpack.io/devbox/internal/boxcli/usererr"
18
17
"go.jetpack.io/devbox/internal/cuecfg"
19
18
"go.jetpack.io/devbox/internal/debug"
@@ -51,9 +50,6 @@ type Stage struct {
51
50
var commitMismatchWarningShown = false
52
51
53
52
func (c * Config ) Packages (w io.Writer ) []string {
54
- if featureflag .Home .Disabled () {
55
- return c .RawPackages
56
- }
57
53
path , err := GlobalConfigPath ()
58
54
if err != nil {
59
55
return c .RawPackages
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import (
12
12
"github.com/fatih/color"
13
13
"github.com/pkg/errors"
14
14
"github.com/samber/lo"
15
+ "go.jetpack.io/devbox/internal/boxcli/usererr"
15
16
"go.jetpack.io/devbox/internal/nix"
16
17
"go.jetpack.io/devbox/internal/planner/plansdk"
17
18
)
@@ -37,7 +38,10 @@ func (d *Devbox) AddGlobal(pkgs ...string) error {
37
38
}
38
39
}
39
40
d .cfg .RawPackages = lo .Uniq (append (d .cfg .RawPackages , added ... ))
40
- return d .saveCfg ()
41
+ if err := d .saveCfg (); err != nil {
42
+ return err
43
+ }
44
+ return ensureGlobalProfileInPath ()
41
45
}
42
46
43
47
func (d * Devbox ) RemoveGlobal (pkgs ... string ) error {
@@ -90,3 +94,18 @@ func GlobalConfigPath() (string, error) {
90
94
}
91
95
return filepath .Join (home , "/.config/devbox/" ), nil
92
96
}
97
+
98
+ // Checks if the global profile is in the path
99
+ func ensureGlobalProfileInPath () error {
100
+ profilePath , err := globalProfilePath ()
101
+ if err != nil {
102
+ return err
103
+ }
104
+ binPath := filepath .Join (profilePath , "bin" )
105
+ if ! strings .Contains (os .Getenv ("PATH" ), binPath ) {
106
+ return usererr .NewWarning (
107
+ "devbox global profile is not in your PATH. Add `export PATH=$PATH:%s` to your shell config to fix this." , binPath ,
108
+ )
109
+ }
110
+ return nil
111
+ }
You can’t perform that action at this time.
0 commit comments