david-swift 29d4c3fe92
All checks were successful
Deploy Docs / publish (push) Successful in 16s
SwiftLint / SwiftLint (push) Successful in 3s
Fix building on macOS fails
2025-01-30 19:37:34 +01:00

28 lines
727 B
Swift

//
// Generation.swift
// Localized
//
// Created by david-swift on 02.03.2024.
//
import Foundation
import GenerationLibrary
try Generation.main()
/// A type containing the generation function for the plugin.
public enum Generation {
/// Generate the Swift code for the plugin.
public static func main() throws {
let yml = try String(contentsOfFile: CommandLine.arguments[1])
let content = try GenerationLibrary.Generation.getCode(yml: yml)
let outputPathIndex = 2
_ = FileManager.default.createFile(
atPath: CommandLine.arguments[outputPathIndex],
contents: .init(("import Localized" + "\n\n" + content[0] + "\n\n" + content[1]).utf8)
)
}
}