Skip to content

Commit

Permalink
use better style for the pretty errors for stack upload
Browse files Browse the repository at this point in the history
  • Loading branch information
kadoban committed Aug 21, 2017
1 parent 6e53c51 commit ab89729
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/main/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
Expand Down

0 comments on commit ab89729

Please sign in to comment.