This commit is contained in:
alessio 2016-08-18 09:29:36 +02:00
parent f81fbecdea
commit 0be93d14c5
1 changed files with 5 additions and 1 deletions

View File

@ -11,10 +11,11 @@ import (
"time" "time"
) )
// The Project struct defines the informations about a project
type Project struct { type Project struct {
reload time.Time reload time.Time
base string base string
Name string `yaml:"app_name,omitempty"` Name string `yaml:"appName,omitempty"`
Path string `yaml:"app_path,omitempty"` Path string `yaml:"app_path,omitempty"`
Main string `yaml:"app_main,omitempty"` Main string `yaml:"app_main,omitempty"`
Run bool `yaml:"app_run,omitempty"` Run bool `yaml:"app_run,omitempty"`
@ -23,6 +24,7 @@ type Project struct {
Watcher Watcher `yaml:"app_watcher,omitempty"` Watcher Watcher `yaml:"app_watcher,omitempty"`
} }
// GoRun is an implementation of the bin execution
func (p *Project) GoRun(channel chan bool, runner chan bool, wr *sync.WaitGroup) error { func (p *Project) GoRun(channel chan bool, runner chan bool, wr *sync.WaitGroup) error {
name := strings.Split(p.Path, "/") name := strings.Split(p.Path, "/")
stop := make(chan bool, 1) stop := make(chan bool, 1)
@ -74,6 +76,7 @@ func (p *Project) GoRun(channel chan bool, runner chan bool, wr *sync.WaitGroup)
} }
} }
// GoBuild an implementation of the "go build"
func (p *Project) GoBuild() error { func (p *Project) GoBuild() error {
var out bytes.Buffer var out bytes.Buffer
@ -92,6 +95,7 @@ func (p *Project) GoBuild() error {
return nil return nil
} }
// GoInstall an implementation of the "go install"
func (p *Project) GoInstall() error { func (p *Project) GoInstall() error {
var out bytes.Buffer var out bytes.Buffer
base, _ := os.Getwd() base, _ := os.Getwd()