Some changes in const vars of the app
This commit is contained in:
parent
e735ae0959
commit
cc568010ee
13
main.go
13
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,
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue