add

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AddCmd = &cobra.Command{
	Use:   "add [pkgs...]",
	Short: "install packages",
	Long: `
The "add" subcommand installs packages.`,
	Example: `webman add go
webman add go@18.0.0
webman add go zig rg
webman add go@18.0.0 zig@9.1.0 rg@13.0.0`,
	Run: func(cmd *cobra.Command, args []string) {
		utils.Init()
		if len(args) == 0 {
			cmd.Help()
			os.Exit(0)
		}
		defer os.RemoveAll(utils.WebmanTmpDir)

		if utils.RecipeDirFlag == "" {

			shouldRefresh, err := pkgparse.ShouldRefreshRecipes()
			if err != nil {
				panic(err)
			}
			if shouldRefresh || doRefresh {
				color.HiBlue("Refreshing package recipes")
				if err = pkgparse.RefreshRecipes(); err != nil {
					fmt.Println(err)
				}
			}
		}
		if !InstallAllPkgs(args) {
			color.Magenta("Not all packages installed successfully")
			os.Exit(1)
		}
		color.Green("All %d packages are installed!", len(args))
	},
}

addCmd represents the add command

Functions

func CreateLinks(pkg string, stem string, confBinPaths []string) (bool, error)

func DownloadUrl

func DownloadUrl(url string, filePath string, pkg string, ver string, argNum int, argCount int, ml *multiline.MultiLogger) bool

func InstallAllPkgs

func InstallAllPkgs(args []string) bool

func InstallPkg

func InstallPkg(arg string, argIndex int, argCount int, wg *sync.WaitGroup, ml *multiline.MultiLogger) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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