mirror of https://github.com/nmasse-itix/liche.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
578 B
37 lines
578 B
package main
|
|
|
|
import "os"
|
|
|
|
func main() {
|
|
args, err := getArguments()
|
|
|
|
if err != nil {
|
|
printToStderr(err.Error())
|
|
os.Exit(1)
|
|
}
|
|
|
|
fc := make(chan string, 1024)
|
|
|
|
go findMarkupFiles(args.filenames, args.recursive, fc)
|
|
|
|
rc := make(chan fileResult, 1024)
|
|
s := newSemaphore(args.concurrency)
|
|
c := newFileChecker(args.timeout, args.documentRoot, s)
|
|
|
|
go c.CheckMany(fc, rc)
|
|
|
|
ok := true
|
|
|
|
for r := range rc {
|
|
if !r.Ok() {
|
|
ok = false
|
|
printToStderr(r.String(args.verbose))
|
|
} else if args.verbose {
|
|
printToStderr(r.String(true))
|
|
}
|
|
}
|
|
|
|
if !ok {
|
|
os.Exit(1)
|
|
}
|
|
}
|
|
|