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