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")
|
var outSitemapFile = filepath.Join(outDir, "sitemap.xml")
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
outIndexAbs := filepath.Join(outDir, outIndexFile)
|
// Cleanup and re-create output directory
|
||||||
err := GenerateHTML(readmePath, outIndexAbs)
|
{
|
||||||
|
if err := os.RemoveAll(outDir); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := mkdirAll(outDir); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
err := GenerateHTML(readmePath, outIndexFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user