matryer/goblueprints

Chapter 4 build.bat on windows

Opened this issue · 1 comments

The batch script has lines like

go build -o ../domainfinder/lib/synonyms
That creates a go binary that can be ran in unix/linux/mac but not windows

when I do go build in the synonyms directory it creates a .exe file, but the script creates a synonyms file in the lib folder that windows can't run.

How can I modify the script so that it outputs .exe files into the lib folder?

I solved it by adding .exe in the script:

#!/bin/bash
echo Building domainfinder...
go build -o domainfinder
echo Building synonyms...
cd ../synonyms
go build -o ../domainfinder/lib/synonyms.exe
echo Building available...
cd ../available
go build -o ../domainfinder/lib/available.exe
echo Building sprinkle...
cd ../sprinkle
go build -o ../domainfinder/lib/sprinkle.exe
echo Building coolify...
cd ../coolify
go build -o ../domainfinder/lib/coolify.exe
echo Building domainify...
cd ../domainify
go build -o ../domainfinder/lib/domainify.exe
echo Done.