1
0
Fork 0
mirror of https://github.com/avelino/awesome-go.git synced 2024-11-13 11:14:37 -05:00

cleanup output dir at start

This commit is contained in:
Kirill Zhuravlev 2023-02-04 03:01:22 +01:00 committed by Avelino
parent 3238f9c430
commit 05fe195266
No known key found for this signature in database
GPG key ID: B345B4D52E98180A

14
main.go
View file

@ -45,8 +45,18 @@ var outIndexFile = filepath.Join(outDir, "index.html")
var outSitemapFile = filepath.Join(outDir, "sitemap.xml")
func main() {
outIndexAbs := filepath.Join(outDir, outIndexFile)
err := GenerateHTML(readmePath, outIndexAbs)
// Cleanup and re-create output directory
{
if err := os.RemoveAll(outDir); err != nil {
panic(err)
}
if err := mkdirAll(outDir); err != nil {
panic(err)
}
}
err := GenerateHTML(readmePath, outIndexFile)
if err != nil {
panic(err)
}