@@ -171,17 +171,25 @@ runDiff conf = do
171171whisper :: Config -> String -> IO ()
172172whisper conf s = do unless (isQuiet conf) $ putStrLn s
173173
174+isWindows :: Bool
175+isWindows = os `elem` ["win32", "mingw32", "cygwin32"]
176+
174177setPath :: Config -> IO ()
175178setPath conf = do
176179 maybeEnv <- lookupEnv "IDRIS"
177− idrisEnv <- return $ fromMaybe "" maybeEnv
178− if (idrisEnv /= "")
180+ idrisExists <- case maybeEnv of
181+ Just idrisExe -> do
182+ let exeExtension = if isWindows then ".exe" else ""
183+ doesFileExist (idrisExe ++ exeExtension)
184+ Nothing -> return False
185+ if (idrisExists)
179186 then do
180− idrisAbs <- makeAbsolute idrisEnv
187+ idrisAbs <- makeAbsolute $ fromMaybe "" maybeEnv
181188 setEnv "IDRIS" idrisAbs
182189 whisper conf $ "Using " ++ idrisAbs
183190 else do
184191 path <- getEnv "PATH"
192+ setEnv "IDRIS" ""
185193 let sandbox = "../.cabal-sandbox/bin"
186194 hasBox <- doesDirectoryExist sandbox
187195 bindir <- if hasBox