From cc568010ee2446696dd487bb15d1a317b432cb14 Mon Sep 17 00:00:00 2001 From: Daniele Conventi Date: Tue, 23 Aug 2016 15:17:44 +0200 Subject: [PATCH] Some changes in const vars of the app --- main.go | 13 +++++++++---- realize/app.go | 15 ++------------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/main.go b/main.go index 7afe35d..65bab4e 100644 --- a/main.go +++ b/main.go @@ -10,7 +10,7 @@ import ( func main() { - app := r.Init() + app := r.Info() handle := func(err error) error { if err != nil { @@ -21,7 +21,8 @@ func main() { } header := func() error { - app.Information() + fmt.Println(r.Blue(app.Name) + " - " + r.Blue(app.Version)) + fmt.Println(r.BlueS(app.Description) + "\n") gopath := os.Getenv("GOPATH") if gopath == "" { log.Fatal(r.Red("$GOPATH isn't set up properly")) @@ -34,8 +35,12 @@ func main() { Version: app.Version, Authors: []*cli.Author{ { - Name: app.Author, - Email: app.Email, + Name: "Alessio Pracchia", + Email: "pracchia@hastega.it", + }, + { + Name: "Daniele Conventi", + Email: "conventi@hastega.it", }, }, Usage: app.Description, diff --git a/realize/app.go b/realize/app.go index 3fb4fd3..c5d0133 100644 --- a/realize/app.go +++ b/realize/app.go @@ -13,9 +13,7 @@ import ( const ( AppName = "Realize" AppVersion = "v1.0" - AppEmail = "pracchia@hastega.it" - AppDescription = "Run, install or build your applications on file changes. Output preview and multi project support" - AppAuthor = "Alessio Pracchia" + AppDescription = "A Golang build system with file watchers, output streams and live reload. Run, build and watch file changes with custom paths\n" AppFile = "realize.config.yaml" ) @@ -74,23 +72,14 @@ func init() { } } -// Init is an instance of app with default values -func Init() *App { +func Info() *App { return &App{ Name: AppName, Version: AppVersion, Description: AppDescription, - Author: AppAuthor, - Email: AppEmail, } } -// Information print realize name and description -func (app *App) Information() { - fmt.Println(Blue(app.Name) + " - " + Blue(app.Version)) - fmt.Println(BlueS(app.Description) + "\n") -} - // Cewrites the log timestamp func (writer logWriter) Write(bytes []byte) (int, error) { return fmt.Print(YellowS("[") + time.Now().Format("15:04:05") + YellowS("]") + string(bytes))