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:
parent
e06c202657
commit
9cde9bdbd1
|
|
@ -417,8 +417,13 @@ func (b *Builder) buildHash(hash string) error {
|
||||||
// create place in which to do work
|
// create place in which to do work
|
||||||
workpath := filepath.Join(*buildroot, b.name+"-"+hash[:12])
|
workpath := filepath.Join(*buildroot, b.name+"-"+hash[:12])
|
||||||
if err := os.Mkdir(workpath, mkdirPerm); err != nil {
|
if err := os.Mkdir(workpath, mkdirPerm); err != nil {
|
||||||
|
if err2 := removePath(workpath); err2 != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if err := os.Mkdir(workpath, mkdirPerm); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
defer removePath(workpath)
|
defer removePath(workpath)
|
||||||
|
|
||||||
buildLog, runTime, err := b.buildRepoOnHash(workpath, hash, b.buildCmd())
|
buildLog, runTime, err := b.buildRepoOnHash(workpath, hash, b.buildCmd())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue