build exec fixed
This commit is contained in:
parent
0a4b5eb1be
commit
9e3408bcf5
18
exec.go
18
exec.go
|
@ -75,20 +75,20 @@ func (p *Project) goRun(stop <-chan bool, runner chan bool) {
|
|||
|
||||
}
|
||||
|
||||
if _, err := os.Stat(filepath.Join(p.base, p.path)); err == nil {
|
||||
p.path = filepath.Join(p.base, p.path)
|
||||
}
|
||||
if _, err := os.Stat(filepath.Join(p.base, p.path+".exe")); err == nil {
|
||||
p.path = filepath.Join(p.base, p.path+".exe")
|
||||
}
|
||||
|
||||
if _, err := os.Stat(filepath.Join(getEnvPath("GOBIN"), filepath.Base(p.path))); err == nil {
|
||||
build = exec.Command(filepath.Join(getEnvPath("GOBIN"), filepath.Base(p.path)), args...)
|
||||
} else if _, err := os.Stat(filepath.Join(getEnvPath("GOBIN"), filepath.Base(p.path)) + ".exe"); err == nil {
|
||||
build = exec.Command(filepath.Join(getEnvPath("GOBIN"), filepath.Base(p.path))+".exe", args...)
|
||||
} else {
|
||||
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", ":")
|
||||
path := filepath.Join(p.base, filepath.Base(p.path))
|
||||
if _, err = os.Stat(path); err == nil {
|
||||
build = exec.Command(path, args...)
|
||||
} else if _, err = os.Stat(path + ".exe"); err == nil {
|
||||
build = exec.Command(path+".exe", args...)
|
||||
} else {
|
||||
p.Buffer.StdLog = append(p.Buffer.StdLog, BufferOut{Time: time.Now(), Text: "Can't run a not compiled project"})
|
||||
p.fatal(nil, "Can't run a not compiled project", ":")
|
||||
}
|
||||
}
|
||||
|
||||
defer func() {
|
||||
|
|
Loading…
Reference in New Issue