summaryrefslogtreecommitdiff
path: root/lib/Kiki.hs
diff options
context:
space:
mode:
authorJames Crayne <jim.crayne@gmail.com>2016-04-28 01:56:37 -0400
committerJames Crayne <jim.crayne@gmail.com>2016-04-28 01:56:37 -0400
commitd85f982f505f8a79a38c4082021aa1f0908606d9 (patch)
tree84b2ef8d4637564cce4a546c53f30f8b12da920d /lib/Kiki.hs
parent561f80a5606623c88ea2c5ba746ac24921ba5137 (diff)
use makeRelative, for more flexible mkpath
Diffstat (limited to 'lib/Kiki.hs')
-rw-r--r--lib/Kiki.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Kiki.hs b/lib/Kiki.hs
index 4189f77..38064ff 100644
--- a/lib/Kiki.hs
+++ b/lib/Kiki.hs
@@ -228,7 +228,7 @@ refreshCache rt rootdir = do
228 createSymbolicLink tmpdir (tmpdir ++ ".link") 228 createSymbolicLink tmpdir (tmpdir ++ ".link")
229 lock <- dotlock_create destdir 0 229 lock <- dotlock_create destdir 0
230 T.mapM (flip dotlock_take timeout) lock 230 T.mapM (flip dotlock_take timeout) lock
231 let mkpath pth = tmpdir </> unslash pth 231 let mkpath pth = tmpdir </> unslash (makeRelative destdir pth)
232 commit = do 232 commit = do
233 oldcommit <- (Just <$> readSymbolicLink destdir) 233 oldcommit <- (Just <$> readSymbolicLink destdir)
234 `catch` \e -> do 234 `catch` \e -> do
@@ -244,7 +244,7 @@ refreshCache rt rootdir = do
244 -- let readyReadBeforeWrite pth = do 244 -- let readyReadBeforeWrite pth = do
245 -- let copyIt = do 245 -- let copyIt = do
246 -- createDirectoryIfMissing True (takeDirectory (mkpath pth)) 246 -- createDirectoryIfMissing True (takeDirectory (mkpath pth))
247 -- copyFile (destdir </> unslash pth) (mkpath pth) 247 -- copyFile (destdir </> unslash (makeRelative destdir pth) (mkpath pth)
248 -- doesFileExist (mkpath pth) >>= flip when copyIt 248 -- doesFileExist (mkpath pth) >>= flip when copyIt
249 -- return (mkpath pth) 249 -- return (mkpath pth)
250 return (mkpath, commit {-, readyReadBeforeWrite -}) 250 return (mkpath, commit {-, readyReadBeforeWrite -})