never executed always true always false
1 module Reanimate.Driver.Magick
2 ( magickCmd
3 ) where
4
5 import System.IO.Unsafe (unsafePerformIO)
6 import System.Directory (findExecutable)
7
8 -- |The name of the ImageMagick command. On Unix-like operating systems, the
9 -- command 'convert' does not conflict with the name of other commands. On
10 -- Windows, ImageMagick version 7 is readily available, the command 'magick'
11 -- should be present, and is preferred over 'convert'. If it is not present,
12 -- 'convert' is assumed to be the relevant command.
13 magickCmd :: String
14 -- The use of 'unsafeperformIO' is justified on the basis that if 'magick' is
15 -- found once, it will always be present.
16 magickCmd = unsafePerformIO $ do
17 mPath <- findExecutable "magick"
18 pure $ maybe "convert" (const "magick") mPath