Skip to content

Commit

Permalink
refactor(stack): Inline a couple of variables
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Viernau <[email protected]>
  • Loading branch information
fviernau authored and sschuberth committed Jul 3, 2024
1 parent 46ff1b8 commit 17ff138
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions plugins/package-managers/stack/src/main/kotlin/Stack.kt
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,10 @@ private fun parseCabalFile(cabal: String, identifierType: String): Package {
url = "${getPackageUrl(id.name, id.version)}/${id.name}-${id.version}.tar.gz"
)

val vcsType = (map["source-repository-this-type"] ?: map["source-repository-head-type"]).orEmpty()
val vcsUrl = (map["source-repository-this-location"] ?: map["source-repository-head-location"]).orEmpty()
val vcsPath = (map["source-repository-this-subdir"] ?: map["source-repository-head-subdir"]).orEmpty()
val vcs = VcsInfo(
type = VcsType.forName(vcsType),
url = vcsUrl,
path = vcsPath,
type = VcsType.forName((map["source-repository-this-type"] ?: map["source-repository-head-type"]).orEmpty()),
url = (map["source-repository-this-location"] ?: map["source-repository-head-location"]).orEmpty(),
path = (map["source-repository-this-subdir"] ?: map["source-repository-head-subdir"]).orEmpty(),
revision = map["source-repository-this-tag"].orEmpty()
)

Expand Down

0 comments on commit 17ff138

Please sign in to comment.