clear the right file

This commit is contained in:
dre 2021-07-11 17:09:49 +08:00
parent 48ed5014eb
commit 0f4f874b9e

View file

@ -173,6 +173,8 @@ func main() {
} }
for name, section := range sections { for name, section := range sections {
// TODO: come up with sth better as one might have content there.
os.Remove(section.File)
section.Write(section.File) section.Write(section.File)
fmt.Printf("written section listing %s to %s\n", name, section.File) fmt.Printf("written section listing %s to %s\n", name, section.File)
} }
@ -180,8 +182,6 @@ func main() {
section, ok := sections[seconOnRoot] section, ok := sections[seconOnRoot]
if ok { if ok {
sectionFile := filepath.Join(destination, "index."+ext) sectionFile := filepath.Join(destination, "index."+ext)
// TODO: come up with sth better as one might have content there.
os.Remove(sectionFile)
section.Write(sectionFile) section.Write(sectionFile)
fmt.Printf("written section listing for root to %s\n", section.File) fmt.Printf("written section listing for root to %s\n", section.File)
} }