Skip to content

Commit

Permalink
Update GitHub URLs depending on license
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Jan 9, 2025
1 parent 942bb58 commit da92ad3
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/main/kotlin/org/openrewrite/RecipeOrigin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class RecipeOrigin(
fun githubUrl(): String {
return if (isFromCoreLibrary()) {
"https://github.com/openrewrite/rewrite"
} else if (getLicense(this) == License.Proprietary) {
"https://github.com/moderneinc/$artifactId"
} else {
"https://github.com/openrewrite/$artifactId"
}
Expand All @@ -56,7 +58,7 @@ class RecipeOrigin(
val baseUrl = if (isFromCoreLibrary()) {
"https://github.com/openrewrite/rewrite/blob/main/$artifactId/src/main"
} else {
"https://github.com/openrewrite/$artifactId/blob/main/src/main"
githubUrl() + "/blob/main/src/main"
}

// YAML recipes will have a source that ends with META-INF/rewrite/something.yml
Expand All @@ -68,12 +70,7 @@ class RecipeOrigin(
}
}

fun issueTrackerUrl() =
if (isFromCoreLibrary()) {
"https://github.com/openrewrite/rewrite/issues"
} else {
"https://github.com/openrewrite/$artifactId/issues"
}
fun issueTrackerUrl() = githubUrl() + "/issues"

companion object {
private val parsePattern = Pattern.compile("([^:]+):([^:]+):([^:]+):(.+)")
Expand Down

0 comments on commit da92ad3

Please sign in to comment.