added check for fs walk errors

This commit is contained in:
Serge A. Zaitsev 2015-08-30 23:16:51 +02:00
parent 61600d0951
commit b31a2cc1ca
1 changed files with 5 additions and 0 deletions

5
zs.go
View File

@ -243,6 +243,11 @@ func buildAll(watch bool) {
if filepath.Base(path)[0] == '.' || strings.HasPrefix(path, ".") {
return nil
}
// inform user about fs walk errors, but continue iteration
if err != nil {
log.Println("ERROR:", err)
return nil
}
if info.IsDir() {
os.Mkdir(filepath.Join(PUBDIR, path), 0755)