From 65fe3e24fffe5481e7b2e1b9ebca5bd99c8a8ada Mon Sep 17 00:00:00 2001 From: alessio Date: Wed, 27 Jul 2016 10:49:37 +0200 Subject: [PATCH] const variables --- main.go | 26 ++++++++++++++------------ realize/config.go | 6 +++++- realize/run.go | 1 + 3 files changed, 20 insertions(+), 13 deletions(-) create mode 100644 realize/run.go diff --git a/main.go b/main.go index f0c63cd..19e0256 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,15 @@ import ( "github.com/tockins/realize/realize" ) +const( + name = "Realize" + version = "v1.0" + email = "pracchia@hastega.it" + description = "Run and build your applications on file changes. Watch custom paths and specific extensions. Define additional commands and multiple projects" + author = "Alessio Pracchia" + +) + func main() { handle := func(err error) error{ @@ -17,15 +26,15 @@ func main() { } app := &cli.App{ - Name: "Realize", - Version: "v1.0", + Name: name, + Version: version, Authors: []*cli.Author{ &cli.Author{ - Name: "Alessio Pracchia", - Email: "pracchia@hastega.it", + Name: author, + Email: email, }, }, - Usage: "A sort of Webpack for Go. Run, build and watch file changes with custom paths", + Usage: description, Commands: []*cli.Command{ { Name: "run", @@ -91,13 +100,6 @@ func main() { }, }, }, - //Flags: []cli.Flag { - // &cli.StringFlag{ - // Name: "run", - // Value: "main.go", - // Usage: "main file of your project", - // }, - //}, } app.Run(os.Args) diff --git a/realize/config.go b/realize/config.go index 5436dc2..556b899 100644 --- a/realize/config.go +++ b/realize/config.go @@ -10,6 +10,10 @@ import ( "fmt" ) +const( + file = "realize.config.yaml" +) + type Config struct { file string `yaml:"app_file,omitempty"` Version string `yaml:"version,omitempty"` @@ -34,7 +38,7 @@ type Watcher struct{ // Default value func New(params *cli.Context) *Config{ return &Config{ - file: "realize.config.yaml", + file: file, Version: "1.0", Projects: []Project{ { diff --git a/realize/run.go b/realize/run.go new file mode 100644 index 0000000..4b7b005 --- /dev/null +++ b/realize/run.go @@ -0,0 +1 @@ +package realize