Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1092 from seanyoung/bindir
Browse files Browse the repository at this point in the history
burrow deploy: ensure directory exists for saving contact
  • Loading branch information
gregdhill authored Apr 9, 2019
2 parents 09ed9eb + 8ea2d01 commit 7c49ae9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion deploy/jobs/jobs_contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func BuildJob(build *def.Build, deployScript *def.Playbook, resp *compilers.Resp
binP := build.BinPath
if binP == "" {
binP = deployScript.BinPath

} else {
if _, err := os.Stat(binP); os.IsNotExist(err) {
if err := os.Mkdir(binP, 0775); err != nil {
return "", err
Expand Down Expand Up @@ -79,6 +79,12 @@ func BuildJob(build *def.Build, deployScript *def.Playbook, resp *compilers.Resp
dir := filepath.Dir(build.Store)
file := filepath.Base(build.Store)

if _, err := os.Stat(dir); os.IsNotExist(err) {
if err := os.Mkdir(dir, 0775); err != nil {
return "", err
}
}

err = res.Contract.Save(dir, file)
if err != nil {
return "", err
Expand Down

0 comments on commit 7c49ae9

Please sign in to comment.