-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
19 additions
and
15 deletions.
There are no files selected for viewing
12 changes: 8 additions & 4 deletions
12
test_runner/src/main/kotlin/ftl/domain/DescribeIosVersions.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 |
---|---|---|
@@ -1,17 +1,21 @@ | ||
package ftl.domain | ||
|
||
import flank.common.logLn | ||
import ftl.api.fetchIosOsVersion | ||
import ftl.args.IosArgs | ||
import ftl.client.google.IosCatalog | ||
import ftl.presentation.Output | ||
import ftl.run.exception.FlankConfigurationError | ||
import ftl.run.exception.FlankGeneralError | ||
import java.nio.file.Paths | ||
|
||
interface DescribeIosVersions { | ||
interface DescribeIosVersions : Output { | ||
val configPath: String | ||
val versionId: String | ||
} | ||
|
||
operator fun DescribeIosVersions.invoke() { | ||
if (versionId.isBlank()) throw FlankConfigurationError("Argument VERSION_ID must be specified.") | ||
logLn(IosCatalog.describeSoftwareVersion(IosArgs.loadOrDefault(Paths.get(configPath)).project, versionId)) | ||
fetchIosOsVersion(IosArgs.loadOrDefault(Paths.get(configPath)).project) | ||
.find { it.id == versionId } | ||
?.out() | ||
?: throw FlankGeneralError("ERROR: '$versionId' is not a valid OS version") | ||
} |
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
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