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

Function updateCmdFunc

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

Source from the content-addressed store, hash-verified

65}
66
67func updateCmdFunc(cmd *cobra.Command, args []string, flags *updateCmdFlags) error {
68 if len(args) > 0 && flags.sync {
69 return usererr.New("cannot specify both a package and --sync")
70 }
71
72 if flags.allProjects {
73 return updateAllProjects(cmd, args)
74 }
75
76 if flags.sync {
77 return multi.SyncLockfiles(args)
78 }
79
80 box, err := devbox.Open(&devopt.Opts{
81 Dir: flags.config.path,
82 Environment: flags.config.environment,
83 Stderr: cmd.ErrOrStderr(),
84 })
85 if err != nil {
86 return errors.WithStack(err)
87 }
88
89 return box.Update(cmd.Context(), devopt.UpdateOpts{
90 Pkgs: args,
91 NoInstall: flags.noInstall,
92 })
93}
94
95func updateAllProjects(cmd *cobra.Command, args []string) error {
96 boxes, err := multi.Open(&devopt.Opts{

Callers 1

updateCmdFunction · 0.85

Calls 5

NewFunction · 0.92
SyncLockfilesFunction · 0.92
OpenFunction · 0.92
updateAllProjectsFunction · 0.85
UpdateMethod · 0.80

Tested by

no test coverage detected