mirror of
https://github.com/avelino/awesome-go.git
synced 2024-11-07 16:33:40 +00:00
cleanup output dir at start
This commit is contained in:
parent
3238f9c430
commit
05fe195266
14
main.go
14
main.go
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user