This commit is contained in:
alessio 2017-08-07 23:01:02 +02:00
parent 3dc0560aea
commit fea0250aa0
2 changed files with 18 additions and 8 deletions

View File

@ -5,6 +5,7 @@ import (
"fmt"
"github.com/tockins/realize/style"
cli "gopkg.in/urfave/cli.v2"
"os"
"strings"
)
@ -51,6 +52,14 @@ func (h *Blueprint) Run(p *cli.Context) error {
h.Projects[k].tools = tools
h.Projects[k].parent = h
h.Projects[k].path = h.Projects[k].Path
// env variables
for key, item := range h.Projects[k].Environment {
if err := os.Setenv(key, item); err != nil{
h.Projects[k].Buffer.StdErr = append(h.Projects[k].Buffer.StdErr, err)
}
}
if h.Legacy.Status {
go h.Projects[k].watchByPolling()
} else {

View File

@ -34,14 +34,15 @@ type Project struct {
settings.Settings `yaml:"-"`
LastChangedOn time.Time `yaml:"-" json:"-"`
base string
Name string `yaml:"name" json:"name"`
Path string `yaml:"path" json:"path"`
Cmds Cmds `yaml:"commands" json:"commands"`
Args []string `yaml:"args,omitempty" json:"args,omitempty"`
Watcher Watcher `yaml:"watcher" json:"watcher"`
Streams Streams `yaml:"streams,omitempty" json:"streams,omitempty"`
Buffer Buffer `yaml:"-" json:"buffer"`
ErrorOutputPattern string `yaml:"errorOutputPattern,omitempty" json:"errorOutputPattern,omitempty"`
Name string `yaml:"name" json:"name"`
Path string `yaml:"path" json:"path"`
Environment map[string]string `yaml:"environment" json:"environment"`
Cmds Cmds `yaml:"commands" json:"commands"`
Args []string `yaml:"args,omitempty" json:"args,omitempty"`
Watcher Watcher `yaml:"watcher" json:"watcher"`
Streams Streams `yaml:"streams,omitempty" json:"streams,omitempty"`
Buffer Buffer `yaml:"-" json:"buffer"`
ErrorOutputPattern string `yaml:"errorOutputPattern,omitempty" json:"errorOutputPattern,omitempty"`
parent *Blueprint
path string
tools tools