fix build

This commit is contained in:
Joey Hess 2018-02-19 15:39:52 -04:00
parent 84a74b80ee
commit 0292af8520
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 4 additions and 3 deletions

View file

@ -1,6 +1,6 @@
{- git-annex output messages, including concurrent output to display regions
-
- Copyright 2010-2016 Joey Hess <id@joeyh.name>
- Copyright 2010-2018 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU GPL version 3 or higher.
-}
@ -64,7 +64,7 @@ outputError msg = withMessageState $ \s -> case (outputType s, jsonBuffer s) of
(JSONOutput jsonoptions, Just jb) | jsonErrorMessages jsonoptions ->
let jb' = Just (JSON.addErrorMessage [msg] jb)
in Annex.changeState $ \st ->
st { Annex.output = s { jsonBuffer = jb' }
st { Annex.output = s { jsonBuffer = jb' } }
_
| concurrentOutputEnabled s -> concurrentMessage s True msg go
| otherwise -> go

View file

@ -87,10 +87,11 @@ finalize jsonoptions o
addErrorMessage :: [String] -> Object -> Object
addErrorMessage msg o =
HM.insertWith combinearray "error-messages" (Array $ V.fromList msg ) o
HM.insertWith combinearray "error-messages" v o
where
combinearray (Array new) (Array old) = Array (old <> new)
combinearray new _old = new
v = Array $ V.fromList $ map (String . T.pack) msg
note :: String -> JSONBuilder
note _ Nothing = Nothing