aboutsummaryrefslogtreecommitdiffhomepage
path: root/releaser
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2018-11-26 10:11:22 +0100
committerBjørn Erik Pedersen <[email protected]>2018-12-06 14:37:25 +0100
commit831d23cb4d1ca99cdc15ed31c8ee1f981497be8f (patch)
tree8fe47b1b1b9233448297f8015ce61bbb7da13fc7 /releaser
parent514e18dc27ce37a0e9a231741d616cf29d50d610 (diff)
downloadhugo-831d23cb4d1ca99cdc15ed31c8ee1f981497be8f.tar.gz
hugo-831d23cb4d1ca99cdc15ed31c8ee1f981497be8f.zip
Add tpl/site and tpl/hugo
This means that the current `.Site` and ´.Hugo` is available as a globals, so you can do `site.IsServer`, `hugo.Version` etc. Fixes #5470 Fixes #5467 Fixes #5503
Diffstat (limited to 'releaser')
-rw-r--r--releaser/releaser.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/releaser/releaser.go b/releaser/releaser.go
index 0738fb81c..0c0765a71 100644
--- a/releaser/releaser.go
+++ b/releaser/releaser.go
@@ -25,9 +25,8 @@ import (
"regexp"
"strings"
+ "github.com/gohugoio/hugo/common/hugo"
"github.com/pkg/errors"
-
- "github.com/gohugoio/hugo/helpers"
)
const commitPrefix = "releaser:"
@@ -52,8 +51,8 @@ type ReleaseHandler struct {
git func(args ...string) (string, error)
}
-func (r ReleaseHandler) calculateVersions() (helpers.HugoVersion, helpers.HugoVersion) {
- newVersion := helpers.MustParseHugoVersion(r.cliVersion)
+func (r ReleaseHandler) calculateVersions() (hugo.Version, hugo.Version) {
+ newVersion := hugo.MustParseVersion(r.cliVersion)
finalVersion := newVersion.Next()
finalVersion.PatchLevel = 0
@@ -261,14 +260,14 @@ func (r *ReleaseHandler) release(releaseNotesFile string) error {
return nil
}
-func (r *ReleaseHandler) bumpVersions(ver helpers.HugoVersion) error {
+func (r *ReleaseHandler) bumpVersions(ver hugo.Version) error {
toDev := ""
if ver.Suffix != "" {
toDev = ver.Suffix
}
- if err := r.replaceInFile("helpers/hugo.go",
+ if err := r.replaceInFile("common/hugo/version_current.go",
`Number:(\s{4,})(.*),`, fmt.Sprintf(`Number:${1}%.2f,`, ver.Number),
`PatchLevel:(\s*)(.*),`, fmt.Sprintf(`PatchLevel:${1}%d,`, ver.PatchLevel),
`Suffix:(\s{4,})".*",`, fmt.Sprintf(`Suffix:${1}"%s",`, toDev)); err != nil {