mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-17 20:47:50 +02:00
windows support
This commit is contained in:
parent
d9c8c5f499
commit
0c9147de65
14
pipeline/compress/compress_test.go
Normal file
14
pipeline/compress/compress_test.go
Normal file
@ -0,0 +1,14 @@
|
||||
package compress
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"github.com/docker/docker/pkg/testutil/assert"
|
||||
)
|
||||
|
||||
func TestExtWindows(t *testing.T) {
|
||||
assert.Equal(t, ext("windows"), ".exe")
|
||||
}
|
||||
|
||||
func TestExtOthers(t *testing.T) {
|
||||
assert.Equal(t, ext("linux"), "")
|
||||
}
|
@ -51,7 +51,7 @@ func create(system, arch string, config config.ProjectConfig) error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := addFile(tw, config.BinaryName, binaryName(system, arch, config.BinaryName)); err != nil {
|
||||
if err := addFile(tw, config.BinaryName+ext(system), binaryPath(system, arch, config.BinaryName)); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
@ -85,6 +85,13 @@ func nameFor(system, arch, binary string) string {
|
||||
return binary + "_" + uname.FromGo(system) + "_" + uname.FromGo(arch)
|
||||
}
|
||||
|
||||
func binaryName(system, arch, binary string) string {
|
||||
func binaryPath(system, arch, binary string) string {
|
||||
return "dist/" + nameFor(system, arch, binary) + "/" + binary
|
||||
}
|
||||
|
||||
func ext(system string) string {
|
||||
if system == "windows" {
|
||||
return ".exe"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user