From ded14a0e26094e2a1e06ab9fda67e4368d576657 Mon Sep 17 00:00:00 2001 From: Dmitry Zuikov Date: Sat, 7 Oct 2023 14:48:49 +0300 Subject: [PATCH] minor bugfix --- hbs2-git/lib/HBS2Git/App.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hbs2-git/lib/HBS2Git/App.hs b/hbs2-git/lib/HBS2Git/App.hs index c4829096..a8c3104b 100644 --- a/hbs2-git/lib/HBS2Git/App.hs +++ b/hbs2-git/lib/HBS2Git/App.hs @@ -238,7 +238,8 @@ runWithRPC action = do let answ = parseTop (LBS.unpack o) & fromRight mempty - let so = headMay [ Text.unpack r | ListVal (Key "rpc:" [LitStrVal r]) <- answ ] + so <- pure (headMay [ Text.unpack r | ListVal (Key "rpc:" [LitStrVal r]) <- answ ]) + `orDie` "hbs2-peer rpc not detected" -- FIXME: logger-to-support-colors liftIO $ hPutDoc stderr $ yellow "rpc: found RPC" <+> pretty so @@ -246,8 +247,7 @@ runWithRPC action = do yellow "rpc: add option" <+> parens ("rpc unix" <+> dquotes (pretty so)) <+> "to the config .hbs2/config" <> line <> line - - pure so `orDie` "hbs2-peer rpc not detected" + pure so runApp :: MonadUnliftIO m => WithLog -> App m () -> m () runApp l m = do