Added INFO to external special remote protocol.

It's left up to the special remote to detect when git-annex is new enough
to support the message; an old git-annex will blow up.

This commit was supported by the NSF-funded DataLad project.
This commit is contained in:
Joey Hess 2018-02-06 13:03:55 -04:00
parent 5c8150c6eb
commit 7d9f0e0fbe
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
9 changed files with 59 additions and 8 deletions

View file

@ -15,6 +15,7 @@ module Messages.JSON (
start,
end,
note,
info,
add,
complete,
progress,
@ -77,6 +78,11 @@ note :: String -> JSONBuilder
note s (Just (o, e)) = Just (HM.insert "note" (toJSON s) o, e)
note _ Nothing = Nothing
info :: String -> JSONBuilder
info s _ = Just (o, True)
where
Object o = object ["info" .= toJSON s]
data JSONChunk v where
AesonObject :: Object -> JSONChunk Object
JSONChunk :: ToJSON v => [(String, v)] -> JSONChunk [(String, v)]