feat(RES-43): Fix du warning magick convert (#16)
All checks were successful
gitea-openium/resgen.swift/pipeline/head This commit looks good

Reviewed-on: #16
This commit is contained in:
2025-05-05 10:36:51 +02:00
parent ccda606af5
commit 166026a766
50 changed files with 334 additions and 166 deletions

View File

@ -128,4 +128,22 @@ struct Images: ParsableCommand {
print(error.description)
Self.exit(withError: error)
}
@discardableResult
static func getMagickConvertPath() -> String {
// WARNING: The convert command is deprecated in IMv7, use "magick" instead of "convert"
let taskMagick = Shell.shell(["which", "magick"])
if taskMagick.terminationStatus == 0 {
return taskMagick.output!.removeCharacters(from: CharacterSet.whitespacesAndNewlines) // swiftlint:disable:this force_unwrapping
}
let taskConvert = Shell.shell(["which", "convert"])
if taskConvert.terminationStatus == 0 {
return taskMagick.output!.removeCharacters(from: CharacterSet.whitespacesAndNewlines) // swiftlint:disable:this force_unwrapping
}
let error = ImagesError.magickConvertNotFound
print(error.description)
Self.exit(withError: error)
}
}