base path moved to run method
This commit is contained in:
parent
98b9680984
commit
a68962368d
|
@ -8,6 +8,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
"path/filepath"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Run launches the toolchain for each project
|
// Run launches the toolchain for each project
|
||||||
|
@ -65,6 +66,21 @@ func (h *Blueprint) Run(p *cli.Context) error {
|
||||||
h.Projects[k].Buffer.StdErr = append(h.Projects[k].Buffer.StdErr, BufferOut{Time: time.Now(), Text: err.Error(), Type: "Env error", Stream: ""})
|
h.Projects[k].Buffer.StdErr = append(h.Projects[k].Buffer.StdErr, BufferOut{Time: time.Now(), Text: err.Error(), Type: "Env error", Stream: ""})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// base path of the project
|
||||||
|
wd, err := os.Getwd()
|
||||||
|
if err != nil{
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if element.path == "." || element.path == "/" {
|
||||||
|
h.Projects[k].base = wd
|
||||||
|
h.Projects[k].path = element.Wdir()
|
||||||
|
} else if filepath.IsAbs(element.path) {
|
||||||
|
h.Projects[k].base = element.path
|
||||||
|
} else {
|
||||||
|
h.Projects[k].base = filepath.Join(wd, element.path)
|
||||||
|
}
|
||||||
|
|
||||||
if h.Legacy.Status {
|
if h.Legacy.Status {
|
||||||
go h.Projects[k].watchByPolling()
|
go h.Projects[k].watchByPolling()
|
||||||
} else {
|
} else {
|
||||||
|
@ -175,10 +191,6 @@ func (h *Blueprint) List() error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fmt.Fprintln(style.Output, name, style.Yellow.Regular("Streams"), ":")
|
|
||||||
fmt.Fprintln(style.Output, name, "\t", style.Yellow.Regular("File Out"), ":", style.Magenta.Regular(val.Streams.FileOut))
|
|
||||||
fmt.Fprintln(style.Output, name, "\t", style.Yellow.Regular("File Log"), ":", style.Magenta.Regular(val.Streams.FileLog))
|
|
||||||
fmt.Fprintln(style.Output, name, "\t", style.Yellow.Regular("File Err"), ":", style.Magenta.Regular(val.Streams.FileErr))
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue