concourse / semver-resource

automated semantic version bumping
Apache License 2.0
97 stars 105 forks source link

[Feature request] Git driver: Create directory if it doesn't exist #70

Closed uhinze closed 4 years ago

uhinze commented 6 years ago

When I use the git driver and store the version(s) at the root of the repo, the version file is created if it doesn't exist. However, when the "file" property is a path, semver-resource will throw an error:

error setting version: open /tmp/semver-git-repo/environment-a/team-2/application-x: no such file or directory

This means that I need to create the appropriate directory set up manually before using this on a new application. I suppose that s3 driver behavior is different as S3 doesnt care about directories.

Would it be possible to introduce a small "mkdir -p" kind of step before attempting to store the file?

bodin commented 5 years ago

This would be helpful for us as well. We store multiple versions per service (prev, cur, next) and would like to keep then bundled togethor in a directory.

Happy to write a PR if this is a feature that could be included.

vito commented 5 years ago

Makes sense to me! Happy to review a PR. :+1:

bodin commented 5 years ago

PR submitted

https://github.com/concourse/semver-resource/pull/102

vito commented 4 years ago

merged #102