Skip to content

Commit

Permalink
Merge pull request #102 from bodin/master
Browse files Browse the repository at this point in the history
feat(git): create the path before writing the file
  • Loading branch information
vito authored Sep 25, 2019
2 parents 90b999a + c131ed9 commit 64917ca
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions driver/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,15 @@ const pushRejectedString = "[rejected]"
const pushRemoteRejectedString = "[remote rejected]"

func (driver *GitDriver) writeVersion(newVersion semver.Version) (bool, error) {

path := filepath.Dir(driver.File)
if path != "/" && path != "." {
err := os.MkdirAll(filepath.Join(gitRepoDir, path), 0755)
if err != nil {
return false, err
}
}

err := ioutil.WriteFile(filepath.Join(gitRepoDir, driver.File), []byte(newVersion.String()+"\n"), 0644)
if err != nil {
return false, err
Expand Down

0 comments on commit 64917ca

Please sign in to comment.