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

Function updateCmd

internal/boxcli/update.go:23–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21}
22
23func updateCmd() *cobra.Command {
24 flags := &updateCmdFlags{}
25
26 command := &cobra.Command{
27 Use: "update [pkg]...",
28 Short: "Update packages in your devbox",
29 Long: "Update one, many, or all packages in your devbox. " +
30 "If no packages are specified, all packages will be updated. " +
31 "Legacy non-versioned packages will be converted to @latest versioned " +
32 "packages resolved to their current version.",
33 PreRunE: func(cmd *cobra.Command, args []string) error {
34 if flags.noInstall {
35 return nil
36 }
37 return ensureNixInstalled(cmd, args)
38 },
39 RunE: func(cmd *cobra.Command, args []string) error {
40 return updateCmdFunc(cmd, args, flags)
41 },
42 }
43
44 flags.config.register(command)
45 command.Flags().BoolVar(
46 &flags.sync,
47 "sync-lock",
48 false,
49 "sync all devbox.lock dependencies in multiple projects. "+
50 "Dependencies will sync to the latest local version.",
51 )
52 command.Flags().BoolVar(
53 &flags.allProjects,
54 "all-projects",
55 false,
56 "update all projects in the working directory, recursively.",
57 )
58 command.Flags().BoolVar(
59 &flags.noInstall,
60 "no-install",
61 false,
62 "update lockfile but don't install anything",
63 )
64 return command
65}
66
67func updateCmdFunc(cmd *cobra.Command, args []string, flags *updateCmdFlags) error {
68 if len(args) > 0 && flags.sync {

Callers 2

globalCmdFunction · 0.85
RootCmdFunction · 0.85

Calls 3

ensureNixInstalledFunction · 0.85
updateCmdFuncFunction · 0.85
registerMethod · 0.45

Tested by

no test coverage detected