From 5c43ff4c9ecf2a07ba9a99bf274cf99f4c89e673 Mon Sep 17 00:00:00 2001 From: amesgen Date: Sat, 2 Jan 2021 08:51:57 +0100 Subject: [PATCH] error if we check nothing --- app/ghcup-gen/Validate.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/ghcup-gen/Validate.hs b/app/ghcup-gen/Validate.hs index bdea1fe..c3f689c 100644 --- a/app/ghcup-gen/Validate.hs +++ b/app/ghcup-gen/Validate.hs @@ -184,6 +184,7 @@ validateTarballs (TarballFilter tool versionRegex) dls = do %& indices (maybe (const True) (==) tool) %> each %& indices (matchTest versionRegex . T.unpack . prettyVer) % (viSourceDL % _Just `summing` viArch % each % each % each) + when (null dlis) $ $(logError) [i|no tarballs selected by filter|] *> addError forM_ dlis $ downloadAll -- exit @@ -195,13 +196,13 @@ validateTarballs (TarballFilter tool versionRegex) dls = do pure ExitSuccess where + runLogger = myLoggerT LoggerConfig { lcPrintDebug = True + , colorOutter = B.hPut stderr + , rawOutter = (\_ -> pure ()) + } downloadAll dli = do dirs <- liftIO getDirs let settings = AppState (Settings True False Never Curl False GHCupURL) dirs defaultKeyBindings - let runLogger = myLoggerT LoggerConfig { lcPrintDebug = True - , colorOutter = B.hPut stderr - , rawOutter = (\_ -> pure ()) - } r <- runLogger