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 (
1313
1414 "github.com/fatih/color"
1515 "github.com/pkg/errors"
16- "go.jetpack.io/devbox/internal/boxcli/featureflag"
1716 "go.jetpack.io/devbox/internal/boxcli/usererr"
1817 "go.jetpack.io/devbox/internal/cuecfg"
1918 "go.jetpack.io/devbox/internal/debug"
@@ -51,9 +50,6 @@ type Stage struct {
5150var commitMismatchWarningShown = false
5251
5352func (c * Config ) Packages (w io.Writer ) []string {
54- if featureflag .Home .Disabled () {
55- return c .RawPackages
56- }
5753 path , err := GlobalConfigPath ()
5854 if err != nil {
5955 return c .RawPackages
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import (
1212 "github.com/fatih/color"
1313 "github.com/pkg/errors"
1414 "github.com/samber/lo"
15+ "go.jetpack.io/devbox/internal/boxcli/usererr"
1516 "go.jetpack.io/devbox/internal/nix"
1617 "go.jetpack.io/devbox/internal/planner/plansdk"
1718)
@@ -37,7 +38,10 @@ func (d *Devbox) AddGlobal(pkgs ...string) error {
3738 }
3839 }
3940 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 ()
4145}
4246
4347func (d * Devbox ) RemoveGlobal (pkgs ... string ) error {
@@ -90,3 +94,18 @@ func GlobalConfigPath() (string, error) {
9094 }
9195 return filepath .Join (home , "/.config/devbox/" ), nil
9296}
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