add the addurl command
This commit is contained in:
parent
a140f7148f
commit
6bddebdb79
5 changed files with 125 additions and 31 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue