From 1b00c7f6f4330cbf723b3df316dbd92ac89cf58f Mon Sep 17 00:00:00 2001 From: Terin Stock Date: Sat, 13 Jan 2018 12:00:43 -0800 Subject: feat(main): include ".exe" when building for Windows 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. --- main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 428946f..ece5f12 100644 --- a/main.go +++ b/main.go @@ -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. @@ -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), -- cgit 1.4.1