Skip to content

Commit

Permalink
Add AutoClosable implementation to SemverRelease
Browse files Browse the repository at this point in the history
  • Loading branch information
serpro69 committed Apr 24, 2022
1 parent 3326f07 commit fab2ee7
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import io.github.serpro69.semverkt.spec.Semver
*
* @property currentVersion the current (last) version in a given repository
*/
class SemverRelease {
class SemverRelease : AutoCloseable {
private val repo: Repository
private val config: Configuration

Expand All @@ -41,6 +41,10 @@ class SemverRelease {
currentVersion = { repo.latestVersionTag()?.let { semver(config.git.tag)(it) } }
}

override fun close() {
repo.close()
}

/**
* Returns the next release version after the [currentVersion] based on the [increment].
*/
Expand Down

0 comments on commit fab2ee7

Please sign in to comment.