Commit a4349634 authored by Ian Lynagh's avatar Ian Lynagh

Tweak ghci032

It was failing for me on OS X as canonicalizePath was altering the
capitalisation of the path (on a case-insensitive filesystem).

It now also prints diagnostic info if it fails.
parent b80cc025
import Control.Monad
import System.FilePath import System.FilePath
import System.Directory import System.Directory
wd1 <- getCurrentDirectory wd1 <- getCurrentDirectory
setCurrentDirectory ".." setCurrentDirectory ".."
wd2 <- getCurrentDirectory wd2 <- getCurrentDirectory
wd1_parent <- canonicalizePath (wd1 </> "..") wd1_parent <- canonicalizePath (wd1 </> "..")
wd1_parent `equalFilePath` wd2 wd2' <- canonicalizePath wd2
\ No newline at end of file unless (wd1_parent `equalFilePath` wd2') $ mapM_ print [wd1, wd1_parent, wd2, wd2']
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment