1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-02-05 13:15:26 +02:00
Carlos Alexandro Becker a5f0343368
feat: improve check command (#1435)
* feat: improve check command

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: main test

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: tests, finally

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: lint

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-04-12 14:31:35 -03:00

34 lines
834 B
Go

// Package deprecate provides simple functions to standardize the output
// of deprecation notices on goreleaser
package deprecate
import (
"strings"
"github.com/apex/log"
"github.com/apex/log/handlers/cli"
"github.com/fatih/color"
"github.com/goreleaser/goreleaser/pkg/context"
)
const baseURL = "https://goreleaser.com/deprecations#"
// Notice warns the user about the deprecation of the given property
func Notice(ctx *context.Context, property string) {
ctx.Deprecated = true
cli.Default.Padding += 3
defer func() {
cli.Default.Padding -= 3
}()
// 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,
url,
))
}