Merge pull request #171 from thnt/fix_GOBIN_support_custom_run_method
fix wrong GOBIN, support custom run method
This commit is contained in:
commit
8481c0293b
|
@ -65,7 +65,8 @@ func init() {
|
|||
if build.Default.GOPATH == "" {
|
||||
log.Fatal("$GOPATH isn't set properly")
|
||||
}
|
||||
if err := os.Setenv("GOBIN", filepath.Join(build.Default.GOPATH, "bin")); err != nil {
|
||||
path := filepath.SplitList(build.Default.GOPATH)
|
||||
if err := os.Setenv("GOBIN", filepath.Join(path[len(path)-1], "bin")); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -582,6 +582,9 @@ func (p *Project) run(path string, stream chan Response, stop <-chan bool) (err
|
|||
name = filepath.Base(dirPath)
|
||||
}
|
||||
path = filepath.Join(dirPath, name)
|
||||
if p.Tools.Run.Method != "" {
|
||||
path = p.Tools.Run.Method
|
||||
}
|
||||
if _, err := os.Stat(path); err == nil {
|
||||
build = exec.Command(path, args...)
|
||||
} else if _, err := os.Stat(path + RExtWin); err == nil {
|
||||
|
|
Loading…
Reference in New Issue