@@ -19,12 +19,12 @@ import Data.Version
1919
2020import Language.PureScript.Docs
2121import Language.PureScript.Publish
22+import Language.PureScript.Publish.ErrorsWarnings as Publish
2223
2324import TestUtils
2425
2526main :: IO ()
26−main = do
27− testPackage "tests/support/prelude"
27+main = testPackage "tests/support/prelude"
2828
2929data TestResult
3030 = ParseFailed String
@@ -53,10 +53,11 @@ testRunOptions = defaultPublishOptions
5353-- | Given a directory which contains a package, produce JSON from it, and then
5454-- | attempt to parse it again, and ensure that it doesn't change.
5555testPackage :: String -> IO ()
56−testPackage dir = do
57− pushd dir $ do
58− r <- roundTrip <$> preparePackage testRunOptions
59− case r of
56+testPackage dir = pushd dir $ do
57+ res <- preparePackage testRunOptions
58+ case res of
59+ Left e -> preparePackageError e
60+ Right package -> case roundTrip package of
6061 Pass _ -> do
6162 putStrLn ("psc-publish test passed for: " ++ dir)
6263 pure ()
@@ -64,3 +65,14 @@ testPackage dir = do
6465 putStrLn ("psc-publish tests failed on " ++ dir ++ ":")
6566 putStrLn (show other)
6667 exitFailure
68+ where
69+ preparePackageError e@(UserError BowerJSONNotFound) = do
70+ Publish.printErrorToStdout e
71+ putStrLn ""
72+ putStrLn "=========================================="
73+ putStrLn "Did you forget to update the submodules?"
74+ putStrLn "$ git submodule sync; git submodule update"
75+ putStrLn "=========================================="
76+ putStrLn ""
77+ exitFailure
78+ preparePackageError e = Publish.printErrorToStdout e >> exitFailure