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

@ -36,6 +36,7 @@ type Project struct {
base string
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"`