From ab89729b3dc524b3a9a30887e3f9d62b6e665698 Mon Sep 17 00:00:00 2001 From: Joshua Simmons Date: Sun, 20 Aug 2017 22:02:38 -0700 Subject: [PATCH] use better style for the pretty errors for `stack upload` --- src/main/Main.hs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main/Main.hs b/src/main/Main.hs index 19ac42013b..47ee13e578 100644 --- a/src/main/Main.hs +++ b/src/main/Main.hs @@ -637,10 +637,11 @@ upgradeCmd upgradeOpts' go = withGlobalConfigAndLock go $ -- | Upload to Hackage uploadCmd :: SDistOpts -> GlobalOpts -> IO () uploadCmd (SDistOpts [] _ _ _ _ _) go = - withConfigAndLock go . $prettyErrorL . concat $ - [wordDocs "To upload the current package, please run", - [styleShell (fromString "stack upload .")], - wordDocs "(with the period at the end)"] + withConfigAndLock go . $prettyErrorL $ + [ flow "To upload the current package, please run" + , styleShell "stack upload ." + , flow "(with the period at the end)" + ] uploadCmd sdistOpts go = do let partitionM _ [] = return ([], []) partitionM f (x:xs) = do @@ -652,10 +653,12 @@ uploadCmd sdistOpts go = do withBuildConfigAndLock go $ \_ -> do unless (null invalid) $ do let invalidList = bulletedList $ map (styleFile . fromString) invalid - $prettyError . (<> (line <> invalidList)) - . fillSep . concatMap wordDocs $ - ["stack upload expects a list of sdist tarballs or cabal directories.", - "Can't find:"] + $prettyErrorL $ + [ styleShell "stack upload" + , flow "expects a list of sdist tarballs or cabal directories." + , flow "Can't find:" + , line <> invalidList + ] liftIO exitFailure config <- view configL getCreds <- liftIO (runOnce (Upload.loadCreds config))