2023-04-05 19:36:51 +02:00
|
|
|
import ArgumentParser
|
2024-05-15 10:37:44 +01:00
|
|
|
import CommandLineTools
|
2023-04-05 19:36:51 +02:00
|
|
|
import Foundation
|
|
|
|
|
|
|
|
struct DownloadStrings: ParsableCommand {
|
|
|
|
static var configuration = CommandConfiguration(abstract: "A tool to download localizable strings from localazy")
|
|
|
|
|
|
|
|
@Flag(help: "Use to download translation keys for all languages")
|
|
|
|
var allLanguages = false
|
|
|
|
|
|
|
|
func run() throws {
|
|
|
|
try localazyDownload()
|
2023-04-12 12:03:11 +02:00
|
|
|
try swiftgen()
|
2023-04-05 19:36:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private func localazyDownload() throws {
|
2023-12-15 08:58:34 +00:00
|
|
|
let arguments = allLanguages ? " all" : ""
|
2024-05-15 10:37:44 +01:00
|
|
|
try Zsh.run(command: "localazy download\(arguments)")
|
2023-04-05 19:36:51 +02:00
|
|
|
}
|
2023-04-12 12:03:11 +02:00
|
|
|
|
|
|
|
private func swiftgen() throws {
|
2024-05-15 10:37:44 +01:00
|
|
|
try Zsh.run(command: "swiftgen config run --config Tools/SwiftGen/swiftgen-config.yml")
|
2023-04-12 12:03:11 +02:00
|
|
|
}
|
2023-04-05 19:36:51 +02:00
|
|
|
}
|