add the addurl command

This commit is contained in:
Joey Hess 2011-07-01 17:15:46 -04:00
parent a140f7148f
commit 6bddebdb79
5 changed files with 125 additions and 31 deletions

View file

@ -13,6 +13,7 @@
module PresenceLog (
LogStatus(..),
addLog,
readLog,
writeLog,
logNow,
@ -70,6 +71,11 @@ instance Read LogLine where
bad = ret $ LogLine 0 Undefined ""
ret v = [(v, "")]
addLog :: FilePath -> LogLine -> Annex ()
addLog file line = do
ls <- readLog file
writeLog file (compactLog $ line:ls)
{- Reads a log file.
- Note that the LogLines returned may be in any order. -}
readLog :: FilePath -> Annex [LogLine]