Move getCanonicalFileName(Safe) to Utils module
This commit is contained in:
@@ -174,3 +174,12 @@ withMappedFile file action = lookupMMappedFile file >>= runWithFile
|
||||
liftIO $ removeFile fp
|
||||
return result
|
||||
runWithFile _ = action file
|
||||
|
||||
getCanonicalFileNameSafe :: IOish m => FilePath -> GhcModT m FilePath
|
||||
getCanonicalFileNameSafe fn = do
|
||||
crdl <- cradle
|
||||
let ccfn = cradleCurrentDir crdl </> fn
|
||||
fex <- liftIO $ doesFileExist ccfn
|
||||
if fex
|
||||
then liftIO $ canonicalizePath ccfn
|
||||
else return ccfn
|
||||
|
||||
Reference in New Issue
Block a user