feat(RES-43): Fix du warning magick convert (#16)
All checks were successful
gitea-openium/resgen.swift/pipeline/head This commit looks good
All checks were successful
gitea-openium/resgen.swift/pipeline/head This commit looks good
Reviewed-on: #16
This commit is contained in:
@ -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)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user