Merge pull request #40 from arekkas/resolve-19

This commit is contained in:
Alessio Pracchia 2016-12-22 08:09:05 +01:00 committed by GitHub
commit c622e506fa
2 changed files with 3 additions and 1 deletions

View File

@ -28,7 +28,7 @@ func (h *Blueprint) Run() error {
func (h *Blueprint) Add(p *cli.Context) error { func (h *Blueprint) Add(p *cli.Context) error {
project := Project{ project := Project{
Name: h.name(p), Name: h.name(p),
Path: filepath.Clean(p.String("path")), Path: strings.Replace(filepath.Clean(p.String("path")), "\\", "/", -1),
Build: p.Bool("build"), Build: p.Bool("build"),
Bin: !p.Bool("no-bin"), Bin: !p.Bool("no-bin"),
Run: !p.Bool("no-run"), Run: !p.Bool("no-run"),

View File

@ -34,6 +34,8 @@ func (p *Project) goRun(channel chan bool, runner chan bool, wr *sync.WaitGroup)
} else { } else {
if _, err := os.Stat(filepath.Join(os.Getenv("GOBIN"), filepath.Base(p.path))); err == nil { if _, err := os.Stat(filepath.Join(os.Getenv("GOBIN"), filepath.Base(p.path))); err == nil {
build = exec.Command(filepath.Join(os.Getenv("GOBIN"), filepath.Base(p.path)), params...) build = exec.Command(filepath.Join(os.Getenv("GOBIN"), filepath.Base(p.path)), params...)
} else if _, err := os.Stat(filepath.Join(os.Getenv("GOBIN"), filepath.Base(p.path)) + ".exe"); err == nil {
build = exec.Command(filepath.Join(os.Getenv("GOBIN"), filepath.Base(p.path)) + ".exe", params...)
} else { } else {
p.Buffer.StdLog = append(p.Buffer.StdLog, BufferOut{Time: time.Now(), Text: "Can't run a not compiled project"}) p.Buffer.StdLog = append(p.Buffer.StdLog, BufferOut{Time: time.Now(), Text: "Can't run a not compiled project"})
p.Fatal(err, "Can't run a not compiled project", ":") p.Fatal(err, "Can't run a not compiled project", ":")