()
| 21 | } |
| 22 | |
| 23 | func installCmd() *cobra.Command { |
| 24 | flags := installCmdFlags{} |
| 25 | command := &cobra.Command{ |
| 26 | Use: "install", |
| 27 | Short: "Install all packages mentioned in devbox.json", |
| 28 | Args: cobra.MaximumNArgs(0), |
| 29 | PreRunE: ensureNixInstalled, |
| 30 | RunE: func(cmd *cobra.Command, args []string) error { |
| 31 | return installCmdFunc(cmd, flags) |
| 32 | }, |
| 33 | } |
| 34 | |
| 35 | flags.config.register(command) |
| 36 | command.Flags().BoolVar( |
| 37 | &flags.tidyLockfile, "tidy-lockfile", false, |
| 38 | "Fix missing store paths in the devbox.lock file.", |
| 39 | // Could potentially do more in the future. |
| 40 | ) |
| 41 | |
| 42 | return command |
| 43 | } |
| 44 | |
| 45 | func installCmdFunc(cmd *cobra.Command, flags installCmdFlags) error { |
| 46 | // Check the directory exists. |
no test coverage detected