1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2024-12-29 01:44:39 +02:00

fix: improve deprecate logs (#2841)

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos Alexandro Becker 2022-02-02 15:31:11 -03:00 committed by GitHub
parent 629723dd6b
commit 8db78f68a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 6 deletions

View File

@ -43,10 +43,14 @@ func Notice(ctx *context.Context, property string) {
// NoticeCustom warns the user about the deprecation of the given property.
func NoticeCustom(ctx *context.Context, property, tmpl string) {
ctx.Deprecated = true
cli.Default.Padding += 3
defer func() {
cli.Default.Padding -= 3
}()
// XXX: this is very ugly!
w := log.Log.(*log.Logger).Handler.(*cli.Handler).Writer
handler := cli.New(w)
handler.Padding = cli.Default.Padding + 3
log := &log.Logger{
Handler: handler,
Level: log.InfoLevel,
}
// replaces . and _ with -
url := baseURL + strings.NewReplacer(
".", "",

View File

@ -1,3 +1,3 @@
• first
• DEPRECATED: `foo.bar.whatever` should not be used anymore, check https://goreleaser.com/deprecations#foobarwhatever for more info
• DEPRECATED: `foo.bar.whatever` should not be used anymore, check https://goreleaser.com/deprecations#foobarwhatever for more info
• last

View File

@ -1,3 +1,3 @@
• first
• DEPRECATED: some custom template with a url https://goreleaser.com/deprecations#something-else
• DEPRECATED: some custom template with a url https://goreleaser.com/deprecations#something-else
• last