sync2

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Run = &cli.Command{
	Name:  global.CmdSync2,
	Usage: "sync2 gitbook, 不包含node_modules, suggest",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:  "source",
			Usage: "gitbook数据源",
			Value: "https://github.com/gofulljs/gitbook/archive/refs/tags/3.2.3.tar.gz",
		},
		&cli.StringFlag{
			Name:  "proxy1",
			Usage: fmt.Sprintf(`自定义加速源(前缀+source), 不传采用以下\n%v`, global.Proxy1s),
		},
		&cli.StringFlag{
			Name:  "proxy2",
			Usage: `自定义加速源(替换https://github.com前缀)`,
		},
	},
	Action: func(cctx *cli.Context) error {

		_, bookHome, bookVersionPath, err := cmdutil.GetBookVars(cctx)
		if err != nil {
			return err
		}

		if checkGitbookIsExist(bookVersionPath) {
			return nil
		}

		err = MustDownloadGitbook(bookHome, cctx.String("proxy1"), cctx.String("proxy2"), cctx.String("source"))
		if err != nil {
			return err
		}

		return nodeInstall(bookVersionPath)
	},
}

Functions

func MustDownloadGitbook

func MustDownloadGitbook(rootPath, proxy1, proxy2, sourceURI 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