From 6c482dad4e334f15193495459e1be3fad6220bd0 Mon Sep 17 00:00:00 2001 From: Keagan McClelland Date: Thu, 26 May 2022 17:29:10 -0600 Subject: [PATCH] add comments about cli output --- src/Cli/Cli.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Cli/Cli.hs b/src/Cli/Cli.hs index 7537003..3640ca3 100644 --- a/src/Cli/Cli.hs +++ b/src/Cli/Cli.hs @@ -364,6 +364,7 @@ upload (Upload name mpkg shouldIndex) = do manager <- newTlsManager res <- getResponseBody <$> runReaderT (httpLbs withBody) manager if LB.null res + -- no output is successful then pure () else do $logError (decodeUtf8 $ LB.toStrict res) @@ -394,6 +395,7 @@ index name pkg v = do <&> applyBasicAuth (B8.pack publishCfgRepoUser) (B8.pack publishCfgRepoPass) let withBody = setRequestBodyJSON (IndexPkgReq (PkgId $ toS pkg) v) noBody res <- getResponseBody <$> httpLBS withBody + -- no output is successful if LB.null res then pure () else $logError (decodeUtf8 $ LB.toStrict res) *> exitWith (ExitFailure 1) @@ -406,6 +408,7 @@ deindex name pkg v = do <&> applyBasicAuth (B8.pack publishCfgRepoUser) (B8.pack publishCfgRepoPass) let withBody = setRequestBodyJSON (IndexPkgReq (PkgId $ toS pkg) v) noBody res <- getResponseBody <$> httpLBS withBody + -- no output is successful if LB.null res then pure () else $logError (decodeUtf8 $ LB.toStrict res) *> exitWith (ExitFailure 1)