From 6dfc04a9f670926fcb27cb88a96f75e70a270bf7 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sat, 7 Aug 2021 11:34:07 +0200 Subject: [PATCH] Fix metadata file read in --offline mode --- lib/GHCup/Download.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/GHCup/Download.hs b/lib/GHCup/Download.hs index db4aa8b..5564230 100644 --- a/lib/GHCup/Download.hs +++ b/lib/GHCup/Download.hs @@ -176,7 +176,7 @@ getBase uri = do -- try to download yaml... usually this writes it into cache dir, -- but in some cases not (e.g. when using file://), so we honour -- the return filepath, if any - mYaml <- if noNetwork + mYaml <- if noNetwork && view (uriSchemeL' % schemeBSL') uri /= "file" -- for file://, let it fall through then pure Nothing else handleIO (\e -> warnCache (displayException e) >> pure Nothing) . catchE @_ @_ @'[] (\e@(DownloadFailed _) -> warnCache (prettyShow e) >> pure Nothing)