Refactor in one unique command with subcommand + add a new command to generate ressources from a configuration file
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit

This commit is contained in:
2022-08-30 17:02:11 +02:00
parent a99466f258
commit 264c221604
60 changed files with 825 additions and 235 deletions

View File

@ -0,0 +1,31 @@
//
// FontsToolError.swift
//
//
// Created by Thibaut Schmitt on 13/12/2021.
//
import Foundation
enum FontsToolError: Error {
case fcScan(String, Int32, String?)
case inputFolderNotFound(String)
case fileNotExists(String)
case writeExtension(String, String)
var localizedDescription: String {
switch self {
case .fcScan(let path, let code, let output):
return "error:[\(Fonts.toolName)] Error while getting fontName (fc-scan --format %{postscriptname} \(path). fc-scan exit with \(code) and output is: \(output ?? "no output")"
case .inputFolderNotFound(let inputFolder):
return " error:[\(Fonts.toolName)] Input folder not found: \(inputFolder)"
case .fileNotExists(let filename):
return " error:[\(Fonts.toolName)] File \(filename) does not exists"
case .writeExtension(let filename, let info):
return "error:[\(Fonts.toolName)] An error occured while writing extension in \(filename): \(info)"
}
}
}