WIP
This commit is contained in:
parent
81c7f6a32a
commit
3f968cb1c0
@ -360,13 +360,18 @@ deriving instance Show InstallSetError
|
||||
|
||||
|
||||
-- | A build failed.
|
||||
data BuildFailed = forall es . (ToVariantMaybe BuildFailed es, PopVariant BuildFailed es, Pretty (V es), Show (V es)) => BuildFailed FilePath (V es)
|
||||
data BuildFailed = forall es . (ToVariantMaybe BuildFailed es, PopVariant BuildFailed es, Pretty (V es), Show (V es)) => BuildFailed FilePath (V es) (Just Requirements)
|
||||
|
||||
instance Pretty BuildFailed where
|
||||
pPrint (BuildFailed path reason) =
|
||||
pPrint (BuildFailed path reason req) =
|
||||
case reason of
|
||||
VMaybe (_ :: BuildFailed) -> pPrint reason
|
||||
_ -> text "BuildFailed failed in dir" <+> text (path <> ":") <+> pPrint reason
|
||||
<+> printToolReq'
|
||||
where
|
||||
printToolReq' = case req of
|
||||
Nothing -> T.pack ""
|
||||
Just req' -> prettyRequirementsError req'
|
||||
|
||||
deriving instance Show BuildFailed
|
||||
|
||||
|
@ -68,6 +68,17 @@ prettyRequirements Requirements {..} =
|
||||
n = if not . T.null $ _notes then "\n Note: " <> _notes else ""
|
||||
in "System requirements " <> d <> n
|
||||
|
||||
|
||||
prettyRequirementsError :: Requirements -> T.Text
|
||||
prettyRequirementsError Requirements {..} =
|
||||
let d = if not . null $ _distroPKGs
|
||||
then "\nMake sure the following distro packages "
|
||||
<> "are installed: "
|
||||
<> T.intercalate " " _distroPKGs
|
||||
else ""
|
||||
n = if not . T.null $ _notes then "\nMake sure the following requirements are met: " <> _notes else ""
|
||||
in d <> n
|
||||
|
||||
rawRequirements :: Requirements -> T.Text
|
||||
rawRequirements Requirements {..} =
|
||||
if not . null $ _distroPKGs
|
||||
|
Loading…
Reference in New Issue
Block a user