Add checker class to check if generation of font are required + Split CLIToolCore in multiple file (one by class)

This commit is contained in:
2021-12-22 10:28:38 +01:00
parent e8545955f6
commit 780efc8817
12 changed files with 251 additions and 40 deletions

View File

@@ -9,7 +9,7 @@ import Foundation
import CLIToolCore
class FontToolHelper {
static func getFontsData(fromInputFolder inputFolder: String) -> (fontsNames: [String], fontsFileNames: [String]) {
static func getFontsFilenames(fromInputFolder inputFolder: String) -> [String] {
// Get a enumerator for all files
let fileManager = FileManager()
@@ -28,10 +28,12 @@ class FontToolHelper {
return false
}
return fontsFileNames
}
static func getFontsNames(fontsFileNames: [String]) -> [String] {
// Get font name (font name and font file name can be different)
let fontsNames = fontsFileNames.compactMap { getFontName(atPath: "\(inputFolder)/\($0)") }
return (fontsNames: fontsNames, fontsFileNames: fontsFileNames)
fontsFileNames.compactMap { getFontName(atPath: $0) }
}
private static func getFontName(atPath path: String) -> String {