I have the following file make.sh
which 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 is working!
#!/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 run the ‘make.sh’ it 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 the make.sh
inside the server folder
as is and it create the tar but its not valid…any idea what should I change the script here to adopt to the new project structure?
EDIT1
Before the structure which is generated is like following
tmp
myapp
myapp
myapp_mac
myapp_win64.exe
myapp.tar.gz
After trying the script in the answer of Charles Duffy
I got the following
tmp
myapp
myapp
myapp_mac
myapp_win64.exe
The tar file is missing, any idea ?