check the gopath before start

This commit is contained in:
alessio 2016-08-21 16:35:17 +02:00
parent 09873ae083
commit 9ef0d84ab6
1 changed files with 15 additions and 9 deletions

12
main.go
View File

@ -1,10 +1,11 @@
package main
import (
"fmt"
r "github.com/tockins/realize/realize"
"gopkg.in/urfave/cli.v2"
"log"
"os"
"fmt"
"strings"
)
@ -20,8 +21,13 @@ func main() {
return nil
}
header := func() {
header := func() error {
app.Information()
gopath := os.Getenv("GOPATH")
if gopath == "" {
log.Fatal(r.Red("$GOPATH isn't set up properly"))
}
return nil
}
wd := func() string {
@ -38,7 +44,7 @@ func main() {
Name: app.Name,
Version: app.Version,
Authors: []*cli.Author{
&cli.Author{
{
Name: app.Author,
Email: app.Email,
},