diff --git a/realize/project.go b/realize/project.go new file mode 100644 index 0000000..6dc0b50 --- /dev/null +++ b/realize/project.go @@ -0,0 +1,43 @@ +package realize + +import ( + "time" + "os/exec" + "os" + "bytes" +) + +type Project struct { + reload time.Time + Name string `yaml:"app_name,omitempty"` + Path string `yaml:"app_path,omitempty"` + Main string `yaml:"app_main,omitempty"` + Run bool `yaml:"app_run,omitempty"` + Bin bool `yaml:"app_bin,omitempty"` + Build bool `yaml:"app_build,omitempty"` + Watcher Watcher `yaml:"app_watcher,omitempty"` +} + +func GoRun () error{ + return nil +} + +func (p *Project) GoBuild() error{ + var out bytes.Buffer + base, _ := os.Getwd() + build := exec.Command("go", "build", base + p.Path + p.Main) + //build.Dir = base + p.Path + build.Stdout = &out + if err := build.Run(); err != nil { + return err + } + return nil +} + +func GoInstall() error{ + return nil +} + +func Stop() error{ + return nil +} \ No newline at end of file diff --git a/realize/run.go b/realize/run.go deleted file mode 100644 index e15eaf9..0000000 --- a/realize/run.go +++ /dev/null @@ -1,17 +0,0 @@ -package realize - -func Run () error{ - return nil -} - -func Build() error{ - return nil -} - -func Install() error{ - return nil -} - -func Stop() error{ - return nil -} \ No newline at end of file