go.tools/dashboard/builder: try to recreate workpath if already exists

Fixes golang/go#8714.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/148010043
This commit is contained in:
Alex Brainman 2014-09-24 12:59:42 +10:00
parent e06c202657
commit 9cde9bdbd1
1 changed files with 6 additions and 1 deletions

View File

@ -417,7 +417,12 @@ func (b *Builder) buildHash(hash string) error {
// create place in which to do work
workpath := filepath.Join(*buildroot, b.name+"-"+hash[:12])
if err := os.Mkdir(workpath, mkdirPerm); err != nil {
return err
if err2 := removePath(workpath); err2 != nil {
return err
}
if err := os.Mkdir(workpath, mkdirPerm); err != nil {
return err
}
}
defer removePath(workpath)