Skip to content

Commit

Permalink
better error when trying to package a versionAlias that does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
NikkyAI committed Mar 14, 2021
1 parent 7978146 commit 4e72f06
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions voodoo/src/main/kotlin/voodoo/cli/PackageCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class PackageCommand(): CliktCommand(
).choice(Pack.packMap)
.multiple()


val uploadDirOption by option("--uploadDir")
.file(canBeFile = false, canBeDir = true, canBeSymlink = false, mustBeWritable = true)

Expand Down Expand Up @@ -88,7 +87,7 @@ class PackageCommand(): CliktCommand(

// packaging aliases
metaPack.packConfig.versionAlias.forEach { (alias, version) ->
val lockpack = lockPacks.first { it.version == version }
val lockpack = lockPacks.firstOrNull() { it.version == version } ?: error("no version matching $version found for alias $alias")
withLoggingContext("alias" to alias,"version" to lockpack.version) {
launch(MDCContext() + CoroutineName("package-version-${lockpack.version}")) {
Pack.pack("pack-${packTarget.id}".watch, lockpack, metaPack.packConfig, uploadDir, packTarget, versionAlias = alias)
Expand Down

0 comments on commit 4e72f06

Please sign in to comment.