check the gopath before start
This commit is contained in:
parent
09873ae083
commit
9ef0d84ab6
12
main.go
12
main.go
|
@ -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,
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue