@@ -735,12 +735,10 @@ renderTags' = renderTagsOptions
735735
736736-- | Perform an IO action in a directory, returning to starting directory.
737737inDirectory :: FilePath -> IO a -> IO a
738−inDirectory path action = do
739− oldDir <- getCurrentDirectory
740− setCurrentDirectory path
741− result <- action
742− setCurrentDirectory oldDir
743− return result
738+inDirectory path action = E.bracket
739+ getCurrentDirectory
740+ setCurrentDirectory
741+ (const $ setCurrentDirectory path >> action)
744742
745743readDefaultDataFile :: FilePath -> IO BS.ByteString
746744readDefaultDataFile fname =