add

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AddCmd = &cobra.Command{
	Use:   "add [group]",
	Short: "install a group of packages",
	Long: `

The "group add" subcommand installs a group of packages.
`,
	RunE: func(cmd *cobra.Command, args []string) error {
		if len(args) != 1 {
			cmd.Help()
			return errors.New("Expected a single package group name")
		}
		cfg, err := config.Load()
		if err != nil {
			return err
		}
		if utils.RecipeDirFlag == "" {

			for _, pkgRepo := range cfg.PkgRepos {
				shouldRefresh, err := pkgRepo.ShouldRefreshRecipes(cfg.RefreshInterval)
				if err != nil {
					return err
				}
				if shouldRefresh || doRefresh {
					color.HiBlue("Refreshing package recipes for %q...", pkgRepo.Name)
					if err = pkgRepo.RefreshRecipes(); err != nil {
						fmt.Println(err)
					} else {
						color.HiBlue("%s%sRefreshed package recipes!",
							multiline.MoveUp, multiline.ClearLine)
					}
				}
			}
		}
		group := args[0]
		return InstallGroup(cfg, group)
	},
}

Functions

func InstallGroup added in v0.11.0

func InstallGroup(cfg *config.Config, group string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL