plan-b 0.1.0 → 0.1.1
raw patch · 3 files changed
+18/−12 lines, 3 filesdep ~path-iodep ~plan-b
Dependency ranges changed: path-io, plan-b
Files
- CHANGELOG.md +6/−0
- System/PlanB.hs +8/−8
- plan-b.cabal +4/−4
CHANGELOG.md view
@@ -1,3 +1,9 @@+## Plan B 0.1.1++* Fixed the problem with moving of files and directories from `/tmp/` to+ some location not under `/tmp/` resulting in “unsupported operation”+ exception on Unix. Now they are moved by copying.+ ## Plan B 0.1.0 * Initial release.
System/PlanB.hs view
@@ -61,7 +61,7 @@ withNewFile pbc fpath action = withTempDir pbc $ \tdir -> do let apath = constructFilePath tdir fpath checkExistenceOfFile pbc apath fpath- liftM2 const (action apath) (P.renameFile apath fpath)+ liftM2 const (action apath) (P.copyFile apath fpath) -- | Edit existing file. Name of the file is taken as the second -- argument. The third argument allows to perform actions on temporary copy@@ -78,7 +78,7 @@ withExistingFile pbc fpath action = withTempDir pbc $ \tdir -> do let apath = constructFilePath tdir fpath copyFile fpath apath- liftM2 const (action apath) (P.renameFile apath fpath)+ liftM2 const (action apath) (P.copyFile apath fpath) ---------------------------------------------------------------------------- -- Operations on directories@@ -98,7 +98,7 @@ -> m a withNewDir pbc dpath action = withTempDir pbc $ \tdir -> do checkExistenceOfDir pbc tdir dpath- liftM2 const (action tdir) (moveDir tdir dpath)+ liftM2 const (action tdir) (copyDir' tdir dpath) -- | Edit existing directory. Name of the directory is specified as the -- second argument. The third argument allows to perform actions in@@ -114,7 +114,7 @@ -> m a withExistingDir pbc dpath action = withTempDir pbc $ \tdir -> do copyDir dpath tdir- liftM2 const (action tdir) (moveDir tdir dpath)+ liftM2 const (action tdir) (copyDir' tdir dpath) ---------------------------------------------------------------------------- -- Operations on containers@@ -246,17 +246,17 @@ Just AebOverride -> return () Just AebUse -> copyDir dpath apath --- | Move specified directory to another location. If destination location+-- | Copy specified directory to another location. If destination location -- is already occupied, delete that object first. -moveDir :: MonadIO m+copyDir' :: (MonadIO m, MonadCatch m) => Path b0 Dir -- ^ Original location -> Path b1 Dir -- ^ Where to move -> m ()-moveDir src dest = do+copyDir' src dest = do exists <- P.doesDirExist dest when exists (P.removeDirRecur dest)- P.renameDir src dest+ P.copyDirRecur src dest -- | Copy file to new location. Throw 'doesNotExistErrorType' if it does not -- exist.
plan-b.cabal view
@@ -31,7 +31,7 @@ -- POSSIBILITY OF SUCH DAMAGE. name: plan-b-version: 0.1.0+version: 0.1.1 cabal-version: >= 1.10 license: BSD3 license-file: LICENSE.md@@ -55,7 +55,7 @@ build-depends: base >= 4.7 && < 5 , exceptions >= 0.8 , path >= 0.5- , path-io >= 0.2+ , path-io >= 1.0.1 , transformers >= 0.3 exposed-modules: System.PlanB , System.PlanB.Type@@ -76,8 +76,8 @@ build-depends: base >= 4.7 && < 5 , hspec >= 2.0 , path >= 0.5- , path-io >= 0.2- , plan-b >= 0.1.0+ , path-io >= 1.0.1+ , plan-b >= 0.1.1 default-language: Haskell2010 source-repository head