enhance runtime dependencies scout

This commit is contained in:
Liang Ding 2015-04-15 17:01:01 +08:00
parent f288d76eb9
commit 869ca61809
2 changed files with 11 additions and 3 deletions

View File

@ -277,7 +277,7 @@ func checkEnv() {
if nil != err {
event.EventQueue <- &event.Event{Code: event.EvtCodeGocodeNotFound}
logger.Warnf("Not found gocode [%s]", gocode)
logger.Warnf("Not found gocode [%s], please install it with this command: go get github.com/nsf/gocode", gocode)
}
ideStub := util.Go.GetExecutableInGOBIN("ide_stub")
@ -286,7 +286,7 @@ func checkEnv() {
if nil != err {
event.EventQueue <- &event.Event{Code: event.EvtCodeIDEStubNotFound}
logger.Warnf("Not found ide_stub [%s]", ideStub)
logger.Warnf("Not found ide_stub [%s], please install it with this command: go get github.com/88250/ide_stub", ideStub)
}
}

View File

@ -100,5 +100,13 @@ func (*mygo) GetExecutableInGOBIN(executable string) string {
}
// $GOBIN/executable
return os.Getenv("GOBIN") + pathSeparator + executable
gobin := os.Getenv("GOBIN")
if "" != gobin {
ret = gobin + pathSeparator + executable
if File.IsExist(ret) {
return ret
}
}
return "./" + executable
}