Canonicalize FilePath before lookup in withMappedFile
This commit is contained in:
parent
438b15463e
commit
c5f71933f6
@ -162,7 +162,7 @@ canonFilePath f = do
|
|||||||
|
|
||||||
withMappedFile :: (IOish m, GmState m, GmEnv m) =>
|
withMappedFile :: (IOish m, GmState m, GmEnv m) =>
|
||||||
forall a. FilePath -> (FilePath -> m a) -> m a
|
forall a. FilePath -> (FilePath -> m a) -> m a
|
||||||
withMappedFile file action = lookupMMappedFile file >>= runWithFile
|
withMappedFile file action = getCanonicalFileNameSafe file >>= lookupMMappedFile >>= runWithFile
|
||||||
where
|
where
|
||||||
runWithFile (Just (RedirectedMapping to)) = action to
|
runWithFile (Just (RedirectedMapping to)) = action to
|
||||||
runWithFile (Just (MemoryMapping (Just src))) = do
|
runWithFile (Just (MemoryMapping (Just src))) = do
|
||||||
@ -175,7 +175,7 @@ withMappedFile file action = lookupMMappedFile file >>= runWithFile
|
|||||||
return result
|
return result
|
||||||
runWithFile _ = action file
|
runWithFile _ = action file
|
||||||
|
|
||||||
getCanonicalFileNameSafe :: IOish m => FilePath -> GhcModT m FilePath
|
getCanonicalFileNameSafe :: (IOish m, GmEnv m) => FilePath -> m FilePath
|
||||||
getCanonicalFileNameSafe fn = do
|
getCanonicalFileNameSafe fn = do
|
||||||
crdl <- cradle
|
crdl <- cradle
|
||||||
let ccfn = cradleCurrentDir crdl </> fn
|
let ccfn = cradleCurrentDir crdl </> fn
|
||||||
|
Loading…
Reference in New Issue
Block a user