omnifmt 0.2.0.0 → 0.2.0.1
raw patch · 3 files changed
+25/−2 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +16/−0
- omnifmt.cabal +1/−1
- src/Omnifmt/Pipes.hs +8/−1
CHANGELOG.md view
@@ -2,20 +2,36 @@ #### Upcoming +#### v0.2.0.1++*Revisions*++* Fixed a bug causing prettifying to fail across filesystem boundaries. ([#14](https://github.com/hjwylde/omnifmt/issues/14))+ #### v0.2.0.0 *Major*+ * Removed `checkFileExists` from the pipeline (moved to `handle`). ([#12](https://github.com/hjwylde/omnifmt/issues/12)) *Revisions*+ * Changed path outputs to be relative to the root directory. ([#12](https://github.com/hjwylde/omnifmt/issues/12)) +#### v0.1.0.1++*Revisions*++* Fixed a bug causing prettifying to fail across filesystem boundaries. ([#14](https://github.com/hjwylde/omnifmt/issues/14))+ #### v0.1.0.0 *Major*+ * Extracted omnifmt out from git@github.com:hjwylde/git-fmt. ([#1](https://github.com/hjwylde/omnifmt/issues/1)) *Revisions*+ * Fixed a bug causing the program to hang when not in the root directory. ([#7](https://github.com/hjwylde/omnifmt/issues/7)) * Fixed a bug where output files could be created outside of the temp directory. ([#11](https://github.com/hjwylde/omnifmt/issues/11)) * Fixed a bug that omitted searching the drive for a config file. ([#8](https://github.com/hjwylde/omnifmt/issues/8))
omnifmt.cabal view
@@ -1,5 +1,5 @@ name: omnifmt-version: 0.2.0.0+version: 0.2.0.1 author: Henry J. Wylde maintainer: public@hjwylde.com
src/Omnifmt/Pipes.hs view
@@ -36,6 +36,8 @@ import qualified Data.Text as T import Data.Tuple.Extra (fst3) +import GHC.IO.Exception (IOErrorType (..))+ import Omnifmt.Config import Omnifmt.Process @@ -45,6 +47,7 @@ import System.Directory.Extra import System.Exit import System.FilePath+import System.IO.Error -- | A status for a file going through the omnifmt pipeline. data Status = Unknown -- ^ The file has not been processed.@@ -125,7 +128,11 @@ -- This function updates the status to 'Prettified'. commit :: MonadIO m => Pipe (Status, FilePath, FilePath) (Status, FilePath, FilePath) m () commit = select [Ugly] $ \(_, uglyFilePath, prettyFilePath) -> do- liftIO $ renameFile prettyFilePath uglyFilePath+ -- Try move the file, but if it's across a filesystem boundary then we may need to copy instead+ liftIO $ renameFile prettyFilePath uglyFilePath `catchIOError` \e ->+ if ioeGetErrorType e == UnsupportedOperation+ then copyFile prettyFilePath uglyFilePath >> removeFile prettyFilePath+ else ioError e return (Prettified, uglyFilePath, prettyFilePath)