mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-17 20:47:50 +02:00
fix: cleaning up
This commit is contained in:
parent
df5d9c0b43
commit
92b9d92bc8
@ -119,8 +119,7 @@ func create(ctx *context.Context, artifacts []artifact.Artifact) error {
|
||||
func skip(ctx *context.Context, artifacts []artifact.Artifact) error {
|
||||
for _, a := range artifacts {
|
||||
log.WithField("binary", a.Name).Info("skip archiving")
|
||||
// TODO: this should not happen here, maybe add another extra field
|
||||
// for the extension and/or name without extension?
|
||||
// TODO: this should not happen here, maybe add another extra field for the extension and/or name without extension?
|
||||
name, err := nametemplate.Apply(ctx, a, strings.TrimSuffix(a.Name, ".exe"))
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -164,47 +164,6 @@ func TestRunPipe(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
// TODO: this test is irrelevant and can probavly be removed
|
||||
func TestRunPipeFormatOverride(t *testing.T) {
|
||||
folder, err := ioutil.TempDir("", "goreleasertest")
|
||||
assert.NoError(t, err)
|
||||
var path = filepath.Join(folder, "bin.zip")
|
||||
_, err = os.Create(path)
|
||||
assert.NoError(t, err)
|
||||
var ctx = context.New(
|
||||
config.Project{
|
||||
Dist: folder,
|
||||
Archive: config.Archive{
|
||||
Format: "tar.gz",
|
||||
FormatOverrides: []config.FormatOverride{
|
||||
{
|
||||
Format: "zip",
|
||||
Goos: "darwin",
|
||||
},
|
||||
},
|
||||
},
|
||||
Brew: config.Homebrew{
|
||||
GitHub: config.Repo{
|
||||
Owner: "test",
|
||||
Name: "test",
|
||||
},
|
||||
},
|
||||
},
|
||||
)
|
||||
ctx.Publish = true
|
||||
ctx.Artifacts.Add(artifact.Artifact{
|
||||
Name: "bin.zip",
|
||||
Path: path,
|
||||
Goos: "darwin",
|
||||
Goarch: "amd64",
|
||||
Type: artifact.UploadableArchive,
|
||||
})
|
||||
client := &DummyClient{}
|
||||
assert.NoError(t, doRun(ctx, client))
|
||||
assert.True(t, client.CreatedFile)
|
||||
assert.Contains(t, client.Content, "bin.zip")
|
||||
}
|
||||
|
||||
func TestRunPipeNoDarwin64Build(t *testing.T) {
|
||||
var ctx = &context.Context{
|
||||
Config: config.Project{
|
||||
|
Loading…
x
Reference in New Issue
Block a user