@@ -171,17 +171,25 @@ runDiff conf = do
171whisper :: Config -> String -> IO ()
171whisper :: Config -> String -> IO ()
172whisper conf s = do unless (isQuiet conf) $ putStrLn s
172whisper conf s = do unless (isQuiet conf) $ putStrLn s
175+isWindows = os `elem` ["win32", "mingw32", "cygwin32"]
174setPath :: Config -> IO ()
177setPath :: Config -> IO ()
175setPath conf = do
178setPath conf = do
176 maybeEnv <- lookupEnv "IDRIS"
179 maybeEnv <- lookupEnv "IDRIS"
177− idrisEnv <- return $ fromMaybe "" maybeEnv
180+ idrisExists <- case maybeEnv of
178− if (idrisEnv /= "")
181+ Just idrisExe -> do
182+ let exeExtension = if isWindows then ".exe" else ""
183+ doesFileExist (idrisExe ++ exeExtension)
184+ Nothing -> return False
180− idrisAbs <- makeAbsolute idrisEnv
187+ idrisAbs <- makeAbsolute $ fromMaybe "" maybeEnv
181 setEnv "IDRIS" idrisAbs
188 setEnv "IDRIS" idrisAbs
182 whisper conf $ "Using " ++ idrisAbs
189 whisper conf $ "Using " ++ idrisAbs
184 path <- getEnv "PATH"
191 path <- getEnv "PATH"
185 let sandbox = "../.cabal-sandbox/bin"
193 let sandbox = "../.cabal-sandbox/bin"
186 hasBox <- doesDirectoryExist sandbox
194 hasBox <- doesDirectoryExist sandbox
187 bindir <- if hasBox
195 bindir <- if hasBox