Fix error/warning message to be shown in Xcode.IssueNavigator
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit

This commit is contained in:
2022-11-22 17:14:13 +01:00
parent 5a3d273acc
commit fc427733ee
27 changed files with 79 additions and 79 deletions

View File

@ -66,20 +66,20 @@ struct Twine: ParsableCommand {
// Input file
guard fileManager.fileExists(atPath: options.inputFile) else {
let error = TwineError.fileNotExists(options.inputFile)
print(error.localizedDescription)
print(error.description)
Twine.exit(withError: error)
}
// Langs
guard options.langs.isEmpty == false else {
let error = TwineError.langsListEmpty
print(error.localizedDescription)
print(error.description)
Twine.exit(withError: error)
}
guard options.langs.contains(options.defaultLang) else {
let error = TwineError.defaultLangsNotInLangs
print(error.localizedDescription)
print(error.description)
Twine.exit(withError: error)
}

View File

@ -15,13 +15,13 @@ enum TwineError: Error {
var localizedDescription: String {
switch self {
case .fileNotExists(let filename):
return " error:[\(Twine.toolName)] File \(filename) does not exists "
return "error: [\(Twine.toolName)] File \(filename) does not exists "
case .langsListEmpty:
return " error:[\(Twine.toolName)] Langs list is empty"
return "error: [\(Twine.toolName)] Langs list is empty"
case .defaultLangsNotInLangs:
return " error:[\(Twine.toolName)] Langs list does not contains the default lang"
return "error: [\(Twine.toolName)] Langs list does not contains the default lang"
}
}
}