packages feed

omnifmt 0.2.1.0 → 0.2.1.1

raw patch · 3 files changed

+27/−2 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -2,6 +2,12 @@  #### Upcoming +#### v0.2.1.1++*Revisions*++* Fixed a bug that disallowed global info options in a non-omnifmt directory. ([#13](https://github.com/hjwylde/omnifmt/issues/13))+ #### v0.2.1.0  *Minor*@@ -12,6 +18,12 @@  * Fixed a bug that disallowed global info options in a non-omnifmt directory. ([#13](https://github.com/hjwylde/omnifmt/issues/13)) +#### 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*@@ -21,6 +33,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 
omnifmt.cabal view
@@ -1,5 +1,5 @@ name:           omnifmt-version:        0.2.1.0+version:        0.2.1.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)