Add withDirectory_
to Utils
This commit is contained in:
parent
aec46dbd51
commit
19b56738c6
@ -18,3 +18,8 @@ readProcess' cmd opts = do
|
||||
fail $ cmd ++ " " ++ unwords opts ++ " (exit " ++ show val ++ ")"
|
||||
ExitSuccess ->
|
||||
return output
|
||||
|
||||
withDirectory_ :: FilePath -> IO a -> IO a
|
||||
withDirectory_ dir action =
|
||||
bracket getCurrentDirectory setCurrentDirectory
|
||||
(\_ -> setCurrentDirectory dir >> action)
|
||||
|
Loading…
Reference in New Issue
Block a user