crawler_manager_go/crawler_util.go

44 lines
798 B
Go
Raw Normal View History

2017-04-15 11:10:33 +00:00
package crawler_manager
import "io/ioutil"
func existConfigFile(prePath string,dir string) bool {
files, _ := ioutil.ReadDir(prePath + "/" +dir)
for _,file := range files {
if file.IsDir() {
retB := existConfigFile(prePath + "/" + dir, file.Name())
if retB {
return true
}
} else {
return true
}
}
return false
}
func existConfigFileDir(prePath string,dir string, configCrawler *[]string) {
files, _ := ioutil.ReadDir(prePath + "/" +dir)
for _,file := range files {
if file.IsDir() {
existConfigFileDir(prePath + "/" + dir, file.Name(), configCrawler)
} else {
*configCrawler = append(*configCrawler, prePath + "/" +dir)
return;
}
}
}
func getRunCommand(container *string ) string {
return BinaryFolder + "/" + *container + "/" + runFile
}