fix: ensure the .buildpacks file exists before writing to it

This commit is contained in:
Jose Diaz-Gonzalez
2019-04-16 22:02:24 -04:00
parent 13e3950f4a
commit 322dd2246f
2 changed files with 23 additions and 1 deletions

View File

@@ -26,7 +26,7 @@ func main() {
}
buildpacksPath := path.Join(tmpWorkDir, ".buildpacks")
file, err := os.OpenFile(buildpacksPath, os.O_RDWR|os.O_TRUNC, 0600)
file, err := os.OpenFile(buildpacksPath, os.O_RDWR|os.O_TRUNC|os.O_CREATE, 0600)
if err != nil {
common.LogFail(fmt.Sprintf("Error writing .buildpacks file: %s", err.Error()))
return