const variables

This commit is contained in:
alessio 2016-07-27 10:49:37 +02:00
parent af16d64d36
commit 65fe3e24ff
3 changed files with 20 additions and 13 deletions

26
main.go
View File

@ -7,6 +7,15 @@ import (
"github.com/tockins/realize/realize" "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() { func main() {
handle := func(err error) error{ handle := func(err error) error{
@ -17,15 +26,15 @@ func main() {
} }
app := &cli.App{ app := &cli.App{
Name: "Realize", Name: name,
Version: "v1.0", Version: version,
Authors: []*cli.Author{ Authors: []*cli.Author{
&cli.Author{ &cli.Author{
Name: "Alessio Pracchia", Name: author,
Email: "pracchia@hastega.it", Email: email,
}, },
}, },
Usage: "A sort of Webpack for Go. Run, build and watch file changes with custom paths", Usage: description,
Commands: []*cli.Command{ Commands: []*cli.Command{
{ {
Name: "run", 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) app.Run(os.Args)

View File

@ -10,6 +10,10 @@ import (
"fmt" "fmt"
) )
const(
file = "realize.config.yaml"
)
type Config struct { type Config struct {
file string `yaml:"app_file,omitempty"` file string `yaml:"app_file,omitempty"`
Version string `yaml:"version,omitempty"` Version string `yaml:"version,omitempty"`
@ -34,7 +38,7 @@ type Watcher struct{
// Default value // Default value
func New(params *cli.Context) *Config{ func New(params *cli.Context) *Config{
return &Config{ return &Config{
file: "realize.config.yaml", file: file,
Version: "1.0", Version: "1.0",
Projects: []Project{ Projects: []Project{
{ {

1
realize/run.go Normal file
View File

@ -0,0 +1 @@
package realize