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:
parent
3238f9c430
commit
05fe195266
1 changed files with 12 additions and 2 deletions
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 a new issue