docs: Bug fix: directory must be removed by os.RemoveAll

This commit is contained in:
Hajime Hoshi 2015-01-18 03:27:28 +09:00
parent db22bf6242
commit 719cc03123

View File

@ -151,23 +151,29 @@ func clear() error {
if err != nil {
return err
}
if m, _ := regexp.MatchString("~$", path); m {
return nil
}
// Remove auto-generated html files.
m, err := regexp.MatchString(".html$", path)
if err != nil {
return err
}
if !m {
return nil
if m {
return os.Remove(path)
}
// Remove example resources that are copied.
m, err = regexp.MatchString("public/example/images", path)
m, err = regexp.MatchString("^public/example/images$", path)
if err != nil {
return err
}
if !m {
return nil
if m {
if err := os.RemoveAll(path); err != nil {
return err
}
return os.Remove(path)
return filepath.SkipDir
}
return nil
}); err != nil {
return err
}