1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-04 03:11:55 +02:00

fix: deprecation notices new url

This commit is contained in:
Carlos Alexandro Becker 2018-04-30 20:58:10 -07:00 committed by Carlos Alexandro Becker
parent 2c851efa1d
commit 38b81ffe7d
2 changed files with 7 additions and 3 deletions

View File

@ -10,7 +10,7 @@ import (
"github.com/fatih/color"
)
const baseURL = "https://goreleaser.com/#deprecation_notices."
const baseURL = "https://goreleaser.com/deprecations#"
// Notice warns the user about the deprecation of the given property
func Notice(property string) {
@ -18,7 +18,11 @@ func Notice(property string) {
defer func() {
cli.Default.Padding -= 3
}()
url := baseURL + strings.Replace(property, ".", "_", -1)
// replaces . and _ with -
url := baseURL + strings.NewReplacer(
".", "-",
"_", "-",
).Replace(property)
log.Warn(color.New(color.Bold, color.FgHiYellow).Sprintf(
"DEPRECATED: `%s` should not be used anymore, check %s for more info.",
property,

View File

@ -19,6 +19,6 @@ func TestNotice(t *testing.T) {
log.Info("last")
assert.Contains(t, out.String(), " • first")
assert.Contains(t, out.String(), " • DEPRECATED: `foo.bar.whatever` should not be used anymore, check https://goreleaser.com/#deprecation_notices.foo_bar_whatever for more info.")
assert.Contains(t, out.String(), " • DEPRECATED: `foo.bar.whatever` should not be used anymore, check https://goreleaser.com/deprecations#foo-bar-whatever for more info.")
assert.Contains(t, out.String(), " • last")
}