Skip to content

Commit

Permalink
fix: Fix version injection (#272)
Browse files Browse the repository at this point in the history
Update `Project.injectedVersion` to check if 'version' is defined before using it.
  • Loading branch information
TomRHandcock authored Dec 4, 2024
1 parent 15c8fe9 commit dd6e19a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ package com.apadmi.mockzilla

import org.gradle.api.Project

fun Project.injectedVersion() = properties["version"].toString().takeUnless { it.isBlank() || it == "unspecified" }
fun Project.injectedVersion() = if (project.hasProperty("version")) properties["version"].toString()
.takeUnless { it.isBlank() || it == "unspecified" } else null

0 comments on commit dd6e19a

Please sign in to comment.