omnifmt 0.1.0.0 → 0.1.0.1
raw patch · 3 files changed
+17/−2 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Omnifmt.Config: instance Data.Aeson.Types.FromJSON.FromJSON Omnifmt.Config.Config
- Omnifmt.Config: instance Data.Aeson.Types.FromJSON.FromJSON Omnifmt.Config.Program
+ Omnifmt.Config: instance Data.Aeson.Types.Class.FromJSON Omnifmt.Config.Config
+ Omnifmt.Config: instance Data.Aeson.Types.Class.FromJSON Omnifmt.Config.Program
Files
- CHANGELOG.md +8/−0
- omnifmt.cabal +1/−1
- src/Omnifmt/Pipes.hs +8/−1
CHANGELOG.md view
@@ -2,12 +2,20 @@ #### Upcoming +#### 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.1.0.0+version: 0.1.0.1 author: Henry J. Wylde maintainer: public@hjwylde.com
src/Omnifmt/Pipes.hs view
@@ -38,6 +38,8 @@ import qualified Data.Text as T import Data.Tuple.Extra (fst3) +import GHC.IO.Exception (IOErrorType (..))+ import Omnifmt.Config import Omnifmt.Process @@ -47,6 +49,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.@@ -135,7 +138,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)