mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-04-17 12:06:50 +02:00
fix: windows filenames (#1539)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
parent
6b80d90ac7
commit
ef19f1610b
@ -81,7 +81,7 @@ func (*Builder) Build(ctx *context.Context, build config.Build, options api.Opti
|
|||||||
Goarm: target.arm,
|
Goarm: target.arm,
|
||||||
Gomips: target.mips,
|
Gomips: target.mips,
|
||||||
Extra: map[string]interface{}{
|
Extra: map[string]interface{}{
|
||||||
"Binary": filepath.Base(options.Path),
|
"Binary": strings.TrimSuffix(filepath.Base(options.Path), options.Ext),
|
||||||
"Ext": options.Ext,
|
"Ext": options.Ext,
|
||||||
"ID": build.ID,
|
"ID": build.ID,
|
||||||
},
|
},
|
||||||
|
@ -117,16 +117,15 @@ func TestBuild(t *testing.T) {
|
|||||||
var ext string
|
var ext string
|
||||||
if strings.HasPrefix(target, "windows") {
|
if strings.HasPrefix(target, "windows") {
|
||||||
ext = ".exe"
|
ext = ".exe"
|
||||||
}
|
} else if target == "js_wasm" {
|
||||||
if target == "js_wasm" {
|
|
||||||
ext = ".wasm"
|
ext = ".wasm"
|
||||||
}
|
}
|
||||||
bin, terr := tmpl.New(ctx).Apply(build.Binary)
|
bin, terr := tmpl.New(ctx).Apply(build.Binary)
|
||||||
require.NoError(t, terr)
|
require.NoError(t, terr)
|
||||||
var err = Default.Build(ctx, build, api.Options{
|
var err = Default.Build(ctx, build, api.Options{
|
||||||
Target: target,
|
Target: target,
|
||||||
Name: bin,
|
Name: bin + ext,
|
||||||
Path: filepath.Join(folder, "dist", target, bin),
|
Path: filepath.Join(folder, "dist", target, bin+ext),
|
||||||
Ext: ext,
|
Ext: ext,
|
||||||
})
|
})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
@ -196,8 +195,8 @@ func TestBuild(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "bin/foo-v5.6.7",
|
Name: "bin/foo-v5.6.7.exe",
|
||||||
Path: filepath.Join(folder, "dist", "windows_amd64", "bin", "foo-v5.6.7"),
|
Path: filepath.Join(folder, "dist", "windows_amd64", "bin", "foo-v5.6.7.exe"),
|
||||||
Goos: "windows",
|
Goos: "windows",
|
||||||
Goarch: "amd64",
|
Goarch: "amd64",
|
||||||
Type: artifact.Binary,
|
Type: artifact.Binary,
|
||||||
@ -208,8 +207,8 @@ func TestBuild(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "bin/foo-v5.6.7",
|
Name: "bin/foo-v5.6.7.wasm",
|
||||||
Path: filepath.Join(folder, "dist", "js_wasm", "bin", "foo-v5.6.7"),
|
Path: filepath.Join(folder, "dist", "js_wasm", "bin", "foo-v5.6.7.wasm"),
|
||||||
Goos: "js",
|
Goos: "js",
|
||||||
Goarch: "wasm",
|
Goarch: "wasm",
|
||||||
Type: artifact.Binary,
|
Type: artifact.Binary,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user