Skip to content

Commit

Permalink
feat(main): include ".exe" when building for Windows
Browse files Browse the repository at this point in the history
When the platform OS is Windows, the output file name should be appended
with ".exe" to match behavior with 'go build', and to allow the
executable to be ran.
  • Loading branch information
terinjokes committed Jan 13, 2018
1 parent c4fa141 commit 1b00c7f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ Bakelite compiles the packages named by the import paths for multiple GOOS and
GOARCH combinations. It does not install their results.
When compiling a package, Bakelite writes the result to output files named
after the source directory in the form "$package_$goos_$goarch".
after the source directory in the form "$package_$goos_$goarch". The '.exe'
suffix is added when writing a Windows executable.
Multiple packages may be given to Bakelite, the result of each are saved as
described in the preceding paragraph.
Expand Down Expand Up @@ -173,6 +174,10 @@ See also: go build, go install, go clean.
func build(ctx context.Context, platform Platform, pkg string) error {
name := fmt.Sprintf("%s-%s-%s", filepath.Base(pkg), platform.OS, platform.Arch)

if platform.OS == OS_WINDOWS {
name += ".exe"
}

env := kvs{
"GOOS": string(platform.OS),
"GOARCH": string(platform.Arch),
Expand Down

0 comments on commit 1b00c7f

Please sign in to comment.