@@ -26,7 +26,6 @@ import System.Exit
2626import System.Process
2727import System.FilePath (pathSeparator)
2828import System.Directory (getCurrentDirectory, getDirectoryContents, findExecutable)
29−import System.Environment (getArgs)
3029import Text.Parsec (ParseError)
3130import qualified Paths_purescript as Paths
3231import qualified System.IO.UTF8 as U
@@ -65,16 +64,12 @@ assertCompiles inputFile = do
6564 putStrLn $ "assert " ++ inputFile ++ " compiles successfully"
6665 prelude <- preludeFilename
6766 assert (P.defaultOptions { P.optionsMain = Just "Main", P.optionsNoOptimizations = True, P.optionsModules = ["Main"] }) [prelude, inputFile] $ either (return . Just) $ \js -> do
68− args <- getArgs
69− if "--run-js" `elem` args
70− then do
71− process <- findNodeProcess
72− result <- traverse (\node -> readProcessWithExitCode node [] js) process
73− case result of
74− Just (ExitSuccess, out, _) -> putStrLn out >> return Nothing
75− Just (ExitFailure _, _, err) -> return $ Just err
76− Nothing -> return $ Just "Couldn't find node.js executable"
77− else return Nothing
67+ process <- findNodeProcess
68+ result <- traverse (\node -> readProcessWithExitCode node [] js) process
69+ case result of
70+ Just (ExitSuccess, out, _) -> putStrLn out >> return Nothing
71+ Just (ExitFailure _, _, err) -> return $ Just err
72+ Nothing -> return $ Just "Couldn't find node.js executable"
7873
7974findNodeProcess :: IO (Maybe String)
8075findNodeProcess = runMaybeT . msum $ map (MaybeT . findExecutable) names