feat(RES-34): Fix plist font filename (#14)
All checks were successful
gitea-openium/resgen.swift/pipeline/head This commit looks good

Reviewed-on: #14
This commit is contained in:
2025-05-05 09:53:05 +02:00
parent 8442c89944
commit 756de4f1de
96 changed files with 3028 additions and 2852 deletions

View File

@ -5,25 +5,28 @@
// Created by Thibaut Schmitt on 10/01/2022.
//
import Foundation
import ArgumentParser
import Foundation
// swiftlint:disable no_grouping_extension
struct TwineOptions: ParsableArguments {
@Flag(name: [.customShort("f"), .customShort("F")], help: "Should force generation")
var forceGeneration = false
@Argument(help: "Input files where strings ared defined.", transform: { $0.replaceTiltWithHomeDirectoryPath() })
var inputFile: String
@Option(help: "Path where to strings file.", transform: { $0.replaceTiltWithHomeDirectoryPath() })
var outputPath: String
@Option(name: .customLong("langs"), help: "Langs to generate.")
fileprivate var langsRaw: String
@Option(help: "Default langs.")
var defaultLang: String
@Option(help: "Path where to generate the extension.", transform: { $0.replaceTiltWithHomeDirectoryPath() })
var extensionOutputPath: String
}
@ -31,6 +34,7 @@ struct TwineOptions: ParsableArguments {
// MARK: - Private var getter
extension TwineOptions {
var langs: [String] {
langsRaw
.split(separator: " ")
@ -41,16 +45,17 @@ extension TwineOptions {
// MARK: - Computed var
extension TwineOptions {
var inputFilenameWithoutExt: String {
URL(fileURLWithPath: inputFile)
.deletingPathExtension()
.lastPathComponent
}
var extensionFilePath: String {
"\(extensionOutputPath)/\(inputFilenameWithoutExt).swift"
}
// "R2String+" is hardcoded in Twine formatter
var extensionFilePathGenerated: String {
"\(extensionOutputPath)/R2String+\(inputFilenameWithoutExt).swift"