Skip to content

Commit

Permalink
Showing 3 changed files with 13 additions and 8 deletions.
7 changes: 3 additions & 4 deletions test_runner/src/main/kotlin/ftl/domain/ListIosLocales.kt
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
package ftl.domain

import flank.common.logLn
import ftl.api.Locale.Identity
import ftl.api.Platform
import ftl.api.fetchLocales
import ftl.args.IosArgs
import ftl.presentation.cli.firebase.test.locale.toCliTable
import ftl.presentation.Output
import java.nio.file.Paths

interface ListIosLocales {
interface ListIosLocales : Output {
val configPath: String
}

operator fun ListIosLocales.invoke() {
logLn(fetchLocales(Identity(IosArgs.loadOrDefault(Paths.get(configPath)).project, Platform.IOS)).toCliTable())
fetchLocales(Identity(IosArgs.loadOrDefault(Paths.get(configPath)).project, Platform.IOS)).out()
}
Original file line number Diff line number Diff line change
@@ -32,10 +32,7 @@ class AndroidLocalesListCommand :

override val out = outputLogger {
@Suppress("UNCHECKED_CAST")
when (this) {
is List<*> -> (this as List<Locale>).toCliTable()
else -> throwUnknownType()
}
(this as? List<Locale>)?.toCliTable() ?: throwUnknownType()
}

@CommandLine.Option(
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
package ftl.presentation.cli.firebase.test.ios.configuration

import ftl.api.Locale
import ftl.config.FtlConstants
import ftl.domain.ListIosLocales
import ftl.domain.invoke
import ftl.presentation.cli.firebase.test.locale.toCliTable
import ftl.presentation.outputLogger
import ftl.presentation.throwUnknownType
import picocli.CommandLine

@CommandLine.Command(
@@ -34,4 +38,9 @@ class IosLocalesListCommand :
var usageHelpRequested: Boolean = false

override fun run() = invoke()

override val out = outputLogger {
@Suppress("UNCHECKED_CAST")
(this as? List<Locale>)?.toCliTable() ?: throwUnknownType()
}
}

0 comments on commit 673fbdb

Please sign in to comment.