@@ -108,7 +108,7 @@ func (d *Devbox) Add(ctx context.Context, platforms, excludePlatforms []string,
108
108
}
109
109
}
110
110
111
- // Resolving here ensures we allow insecure before running ensureDevboxEnvIsUpToDate
111
+ // Resolving here ensures we allow insecure before running ensurePackagesAreInstalled
112
112
// which will call print-dev-env. Resolving does not save the lockfile, we
113
113
// save at the end when everything has succeeded.
114
114
if d .allowInsecureAdds {
@@ -126,7 +126,7 @@ func (d *Devbox) Add(ctx context.Context, platforms, excludePlatforms []string,
126
126
}
127
127
}
128
128
129
- if err := d .ensureDevboxEnvIsUpToDate (ctx , install ); err != nil {
129
+ if err := d .ensurePackagesAreInstalled (ctx , install ); err != nil {
130
130
return usererr .WithUserMessage (err , "There was an error installing nix packages" )
131
131
}
132
132
@@ -190,14 +190,14 @@ func (d *Devbox) Remove(ctx context.Context, pkgs ...string) error {
190
190
}
191
191
192
192
// this will clean up the now-extra package from nix profile and the lockfile
193
- if err := d .ensureDevboxEnvIsUpToDate (ctx , uninstall ); err != nil {
193
+ if err := d .ensurePackagesAreInstalled (ctx , uninstall ); err != nil {
194
194
return err
195
195
}
196
196
197
197
return d .saveCfg ()
198
198
}
199
199
200
- // installMode is an enum for helping with ensureDevboxEnvIsUpToDate implementation
200
+ // installMode is an enum for helping with ensurePackagesAreInstalled implementation
201
201
type installMode string
202
202
203
203
const (
@@ -208,7 +208,7 @@ const (
208
208
ensure installMode = "ensure"
209
209
)
210
210
211
- // ensureDevboxEnvIsUpToDate ensures:
211
+ // ensurePackagesAreInstalled ensures:
212
212
// 1. Packages are installed, in nix-profile or runx.
213
213
// Extraneous packages are removed (references purged, not uninstalled).
214
214
// 2. Files for devbox shellenv are generated
@@ -218,7 +218,8 @@ const (
218
218
// The `mode` is used for:
219
219
// 1. Skipping certain operations that may not apply.
220
220
// 2. User messaging to explain what operations are happening, because this function may take time to execute.
221
- func (d * Devbox ) ensureDevboxEnvIsUpToDate (ctx context.Context , mode installMode ) error {
221
+ // TODO: Rename method since it does more than just ensure packages are installed.
222
+ func (d * Devbox ) ensurePackagesAreInstalled (ctx context.Context , mode installMode ) error {
222
223
defer trace .StartRegion (ctx , "ensurePackages" ).End ()
223
224
defer debug .FunctionTimer ().End ()
224
225
0 commit comments