mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 19:02:12 +08:00
[v2] If using -compiler flag, add go version to filename.
This commit is contained in:
parent
3933c5ab02
commit
3d75ba174b
@ -156,12 +156,25 @@ func (b *BaseBuilder) OutputFilename(options *Options) string {
|
|||||||
if b.projectData.OutputType != "desktop" {
|
if b.projectData.OutputType != "desktop" {
|
||||||
target += "-" + b.projectData.OutputType
|
target += "-" + b.projectData.OutputType
|
||||||
}
|
}
|
||||||
|
// If we aren't using the standard compiler, add it to the filename
|
||||||
|
if options.Compiler != "go" {
|
||||||
|
// Parse the `go version` output. EG: `go version go1.16 windows/amd64`
|
||||||
|
stdout, _, err := shell.RunCommand(".", options.Compiler, "version")
|
||||||
|
if err != nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
versionSplit := strings.Split(stdout, " ")
|
||||||
|
if len(versionSplit) == 4 {
|
||||||
|
target += "-" + versionSplit[2]
|
||||||
|
}
|
||||||
|
}
|
||||||
switch b.options.Platform {
|
switch b.options.Platform {
|
||||||
case "windows":
|
case "windows":
|
||||||
outputFile = b.projectData.OutputFilename
|
outputFile = target + ".exe"
|
||||||
case "darwin", "linux":
|
case "darwin", "linux":
|
||||||
outputFile = fmt.Sprintf("%s-%s-%s", target, b.options.Platform, b.options.Arch)
|
outputFile = fmt.Sprintf("%s-%s-%s", target, b.options.Platform, b.options.Arch)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return outputFile
|
return outputFile
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user