-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using new extension functions for computing links. Decided to use com…
…mit shas instead of branches to be more exact. This doesn't work super well when running on a local branch with a random commit... but that's not the typical use case? Created #16 to track.
- Loading branch information
1 parent
6c17f45
commit 003d5a1
Showing
3 changed files
with
403 additions
and
377 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
invert-report/src/jsMain/kotlin/com/squareup/invert/common/Ext.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.squareup.invert.common | ||
|
||
import com.squareup.invert.models.js.MetadataJsReportModel | ||
|
||
/** TODO fix in https://github.com/square/invert/issues/14 */ | ||
private fun String.plusExamplesForInvertRepo(): String = if (this.contains("square/invert")) { | ||
"$this/examples" | ||
} else { | ||
this | ||
} | ||
|
||
fun MetadataJsReportModel.httpsUrlForBranch() = "${remoteRepoUrl}/tree/${branchName}".plusExamplesForInvertRepo() | ||
|
||
fun MetadataJsReportModel.httpsUrlForCommit() = "${remoteRepoUrl}/blob/${gitSha}".plusExamplesForInvertRepo() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.