New Bee banner

Added a new Bee banner using ASCII art. When bee is invoked,
the banner is displayed with the version number (short banner).
A More verbose Banner is added to 'bee version' which shows
more information about the host and Go runtime.
This commit is contained in:
Faissal Elamraoui
2016-06-01 14:30:29 +02:00
parent 01e7ff3774
commit b8250ebb72
16 changed files with 230 additions and 112 deletions

11
g.go
View File

@ -14,7 +14,10 @@
package main
import "os"
import (
"os"
"strings"
)
var cmdGenerate = &Command{
UsageLine: "generate [Command]",
@ -74,6 +77,8 @@ func init() {
}
func generateCode(cmd *Command, args []string) int {
ShowShortVersionBanner()
curpath, _ := os.Getwd()
if len(args) < 1 {
ColorLog("[ERRO] command is missing\n")
@ -119,7 +124,6 @@ func generateCode(cmd *Command, args []string) int {
os.Exit(2)
}
sname := args[1]
ColorLog("[INFO] Using '%s' as scaffold name\n", sname)
generateScaffold(sname, fields.String(), curpath, driver.String(), conn.String())
case "docs":
generateDocs(curpath)
@ -192,7 +196,6 @@ func generateCode(cmd *Command, args []string) int {
os.Exit(2)
}
sname := args[1]
ColorLog("[INFO] Using '%s' as model name\n", sname)
generateModel(sname, fields.String(), curpath)
case "view":
if len(args) == 2 {
@ -206,6 +209,6 @@ func generateCode(cmd *Command, args []string) int {
default:
ColorLog("[ERRO] command is missing\n")
}
ColorLog("[SUCC] generate successfully created!\n")
ColorLog("[SUCC] %s successfully generated!\n", strings.Title(gcmd))
return 0
}