Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Run = &cli.Command{ Name: global.CmdSync, Usage: "sync gitbook", Flags: []cli.Flag{ &cli.StringFlag{ Name: "source", Usage: "gitbook数据源(包含node_modules)", Value: "https://github.com/gofulljs/gitbook/releases/download/3.2.3/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 { bookVersion := cctx.String("bookVersion") var err error bookHome := cctx.String("bookHome") if bookHome == "" { bookHome, err = getRootPath() if err != nil { return err } } bookVersionPath := filepath.Join(bookHome, bookVersion) if checkGitbookIsExist(bookVersionPath) { return nil } return MustDownloadGitbook(bookHome, cctx.String("proxy1"), cctx.String("proxy2"), cctx.String("source")) }, }
Functions ¶
func MustDownloadGitbook ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.