avatar

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:  "avatar",
	Args: cobra.NoArgs,

	RunE: func(cmd *cobra.Command, args []string) (err error) {
		defer try.Handle(&err)
		prefix := try.E1(cmd.Flags().GetString("prefix"))
		try.E(os.MkdirAll(filepath.Join(prefix, "jpg"), o.DirPerm()))
		try.E(os.MkdirAll(filepath.Join(prefix, "png"), o.DirPerm()))
		for name, url := range urls {
			jpg := filepath.Join(prefix, "jpg", fmt.Sprintf("%s.jpg", name))
			png := filepath.Join(prefix, "png", fmt.Sprintf("%s.png", name))
			try.E(download.Download(url, jpg))
			try.E(ex.Command("magick", "convert", jpg, png).Bind().Run())
		}
		return nil
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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