factor out maybeAddJSONField
Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
This commit is contained in:
parent
3d8f93dc0a
commit
a5d0c85ae1
6 changed files with 22 additions and 18 deletions
|
@ -12,11 +12,10 @@ import Annex.MetaData
|
|||
import Annex.VectorClock
|
||||
import Logs.MetaData
|
||||
import Annex.WorkTree
|
||||
import Messages.JSON (JSONActionItem(..), AddJSONActionItemField(..))
|
||||
import Types.Messages
|
||||
import Utility.Aeson
|
||||
import Utility.SafeOutput
|
||||
import Limit
|
||||
import Messages.JSON (JSONActionItem(..), eitherDecode)
|
||||
|
||||
import qualified Data.Set as S
|
||||
import qualified Data.Map as M
|
||||
|
@ -127,9 +126,7 @@ perform c o k = case getSet o of
|
|||
cleanup :: Key -> CommandCleanup
|
||||
cleanup k = do
|
||||
m <- getCurrentMetaData k
|
||||
case toJSON' (AddJSONActionItemField "fields" m) of
|
||||
Object o -> maybeShowJSON $ AesonObject o
|
||||
_ -> noop
|
||||
maybeAddJSONField "fields" m
|
||||
showLongNote $ UnquotedString $ unlines $ concatMap showmeta $
|
||||
map unwrapmeta (fromMetaData m)
|
||||
return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue