I have the following make.sh file that is working on the following project:
myapp utils run.go auth.go server.go make.sh
When I run this script , it creates the expected tar and everything works!
#!/bin/sh go get ./... rm -r /tmp/myapp rm /tmp/myapp.tar.gz mkdir /tmp/myapp go build -o /tmp/myapp/myapp_mac env GOOS=windows GOARH=amd64 go build -o /tmp/myapp/myapp_win64.exe env GOOS=linux GOARCH=amd64 go build -o /tmp/myapp/myapp cp -R ./resources /tmp/myapp/ cd /tmp tar -czf myapp.tar.gz myapp
Now I needed to change the project structure to the following:
myapp make.sh src utils run.go auth.go server server.go
Now, when I ran make.sh, I got an error:
can't load package: package myapp: no Go files in /Users/i023333/go/src/myapp
Any idea how to adapt it?
I try to put make.sh inside the server folder as it is, and it creates tar, but its invalid ... any idea that I have to modify the script here to accept the new project structure?
EDIT1
Before the structure that is generated looks like the following
tmp myapp myapp myapp_mac myapp_win64.exe myapp.tar.gz
Having tried the script in Charles Duffy answer, I got the following
tmp myapp myapp myapp_mac myapp_win64.exe
The tar file is missing, any idea?