1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2024-12-31 01:53:50 +02:00

Clean logging output

This commit is contained in:
Jorin Vogel 2017-01-19 10:04:41 +01:00
parent 655e64b4bf
commit 6677571e8c
10 changed files with 27 additions and 27 deletions

View File

@ -17,7 +17,7 @@ type Pipe struct{}
// Description of the pipe
func (Pipe) Description() string {
return "Creating archives..."
return "Creating archives"
}
// Run the pipe
@ -41,7 +41,7 @@ type Archive interface {
func create(name string, ctx *context.Context) error {
folder := filepath.Join("dist", name)
file, err := os.Create(folder + "." + ctx.Config.Archive.Format)
log.Println("Creating", file.Name(), "...")
log.Println("Creating", file.Name())
if err != nil {
return err
}

View File

@ -18,7 +18,7 @@ import (
// contain darwin and/or goarch doesn't contain amd64)
var ErrNoDarwin64Build = errors.New("brew tap requires a darwin amd64 build")
const formulae = `class {{ .Name }} < Formula
const formula = `class {{ .Name }} < Formula
desc "{{ .Desc }}"
homepage "{{ .Homepage }}"
url "https://github.com/{{ .Repo }}/releases/download/{{ .Tag }}/{{ .File }}.{{ .Format }}"
@ -63,7 +63,7 @@ type Pipe struct{}
// Description of the pipe
func (Pipe) Description() string {
return "Creating homebrew formulae..."
return "Creating homebrew formula"
}
// Run the pipe
@ -76,8 +76,8 @@ func (Pipe) Run(ctx *context.Context) error {
ctx.Config.Brew.Folder, ctx.Config.Build.BinaryName+".rb",
)
log.Println("Updating", path, "on", ctx.Config.Brew.Repo, "...")
out, err := buildFormulae(ctx, client)
log.Println("Pushing", path, "to", ctx.Config.Brew.Repo)
out, err := buildFormula(ctx, client)
if err != nil {
return err
}
@ -107,17 +107,17 @@ func (Pipe) Run(ctx *context.Context) error {
return err
}
func buildFormulae(ctx *context.Context, client *github.Client) (bytes.Buffer, error) {
func buildFormula(ctx *context.Context, client *github.Client) (bytes.Buffer, error) {
data, err := dataFor(ctx, client)
if err != nil {
return bytes.Buffer{}, err
}
return doBuildFormulae(data)
return doBuildFormula(data)
}
func doBuildFormulae(data templateData) (bytes.Buffer, error) {
func doBuildFormula(data templateData) (bytes.Buffer, error) {
var out bytes.Buffer
tmpl, err := template.New(data.BinaryName).Parse(formulae)
tmpl, err := template.New(data.BinaryName).Parse(formula)
if err != nil {
return out, err
}

View File

@ -45,7 +45,7 @@ func TestFullFormulae(t *testing.T) {
data := defaultTemplateData
data.Caveats = "Here are some caveats"
data.Dependencies = []string{"gtk", "git"}
out, err := doBuildFormulae(data)
out, err := doBuildFormula(data)
assert.NoError(err)
formulae := out.String()
assertDefaultTemplateData(t, formulae)
@ -57,7 +57,7 @@ func TestFullFormulae(t *testing.T) {
func TestFormulaeNoCaveats(t *testing.T) {
assert := assert.New(t)
out, err := doBuildFormulae(defaultTemplateData)
out, err := doBuildFormula(defaultTemplateData)
assert.NoError(err)
formulae := out.String()
assertDefaultTemplateData(t, formulae)

View File

@ -16,7 +16,7 @@ type Pipe struct{}
// Description of the pipe
func (Pipe) Description() string {
return "Building..."
return "Building binaries"
}
// Run the pipe
@ -42,7 +42,7 @@ func (Pipe) Run(ctx *context.Context) error {
func build(name, goos, goarch string, ctx *context.Context) error {
ldflags := ctx.Config.Build.Ldflags + " -X main.version=" + ctx.Git.CurrentTag
output := "dist/" + name + "/" + ctx.Config.Build.BinaryName + extFor(goos)
log.Println("Building", output, "...")
log.Println("Building", output)
cmd := exec.Command(
"go",
"build",

View File

@ -15,7 +15,7 @@ type Pipe struct{}
// Description of the pipe
func (Pipe) Description() string {
return "Setting defaults..."
return "Setting defaults"
}
// Run the pipe

2
pipeline/env/env.go vendored
View File

@ -15,7 +15,7 @@ type Pipe struct{}
// Description of the pipe
func (Pipe) Description() string {
return "Loading data from environment variables..."
return "Loading environment variables"
}
// Run the pipe

View File

@ -7,7 +7,7 @@ type Pipe struct{}
// Description of the pipe
func (Pipe) Description() string {
return "Gathering Git data..."
return "Getting Git info"
}
// Run the pipe

View File

@ -16,7 +16,7 @@ type Pipe struct{}
// Description of the pipe
func (Pipe) Description() string {
return "Releasing to GitHub..."
return "Releasing to GitHub"
}
// Run the pipe
@ -48,11 +48,11 @@ func getOrCreateRelease(client *github.Client, ctx *context.Context) (*github.Re
}
r, _, err := client.Repositories.GetReleaseByTag(owner, repo, ctx.Git.CurrentTag)
if err != nil {
log.Println("Creating release", ctx.Git.CurrentTag, "on", ctx.Config.Release.Repo, "...")
log.Println("Creating release", ctx.Git.CurrentTag, "on", ctx.Config.Release.Repo)
r, _, err = client.Repositories.CreateRelease(owner, repo, data)
return r, err
}
log.Println("Updating existing release", ctx.Git.CurrentTag, "on", ctx.Config.Release.Repo, "...")
log.Println("Updating existing release", ctx.Git.CurrentTag, "on", ctx.Config.Release.Repo)
r, _, err = client.Repositories.EditRelease(owner, repo, *r.ID, data)
return r, err
}
@ -74,7 +74,7 @@ func upload(client *github.Client, releaseID int, archive string, ctx *context.C
return err
}
defer func() { _ = file.Close() }()
log.Println("Uploading", file.Name(), "...")
log.Println("Uploading", file.Name())
_, _, err = client.Repositories.UploadReleaseAsset(
ctx.ReleaseRepo.Owner,
ctx.ReleaseRepo.Name,

View File

@ -11,7 +11,7 @@ type Pipe struct{}
// Description of the pipe
func (Pipe) Description() string {
return "Filling repositories data..."
return "Setting repositories"
}
// Run the pipe

View File

@ -19,7 +19,7 @@ type Pipe struct {
// Description of the pipe
func (p *Pipe) Description() string {
return "Using source from latest tag..."
return "Using source from latest tag"
}
// Run uses the latest tag as source.
@ -30,7 +30,7 @@ func (p *Pipe) Run(ctx *context.Context) error {
dirty := err != nil
if dirty {
log.Println("Stashing changes...")
log.Println("Stashing changes")
cmd = exec.Command("git", "stash", "--include-untracked", "--quiet")
var stdout bytes.Buffer
cmd.Stdout = &stdout
@ -48,7 +48,7 @@ func (p *Pipe) Run(ctx *context.Context) error {
wrongBranch := err != nil
if wrongBranch {
log.Println("Checking out tag...")
log.Println("Checking out tag")
cmd = exec.Command("git", "checkout", ctx.Git.CurrentTag)
var stdout bytes.Buffer
cmd.Stdout = &stdout
@ -66,7 +66,7 @@ func (p *Pipe) Run(ctx *context.Context) error {
// Clean switches back to the original branch and restores changes.
func (p *Pipe) Clean(ctx *context.Context) {
if p.wrongBranch {
log.Println("Checking out original branch...")
log.Println("Checking out original branch")
cmd := exec.Command("git", "checkout", "-")
var stdout bytes.Buffer
cmd.Stdout = &stdout
@ -77,7 +77,7 @@ func (p *Pipe) Clean(ctx *context.Context) {
}
if p.dirty {
log.Println("Popping stashed changes...")
log.Println("Popping stashed changes")
cmd := exec.Command("git", "stash", "pop")
var stdout bytes.Buffer
cmd.Stdout = &stdout