コード例 #1
0
ファイル: book.go プロジェクト: hznoob/go-gitbook-api
// PublishGit packages a git repo as tar.gz and uploads it to gitbook.io
func (b *Book) PublishGit(bookId, version, bookpath, ref string) error {
	tar, err := utils.GitTarGz(bookpath, ref)
	if err != nil {
		return err
	}
	defer tar.Close()

	return b.PublishStream(bookId, version, tar)
}
コード例 #2
0
// Git returns an io.ReadCloser of a repo as a tar.gz
func Git(p, ref string) (io.ReadCloser, error) {
	return utils.GitTarGz(p, ref)
}