@@ -1,5 +1,7 @@
11module Main where
22
3+import Control.Monad (unless)
4+import Data.List (isInfixOf)
35import System.Directory
46import System.Exit
57import System.FilePath
@@ -12,7 +14,8 @@ main = do
1214 top <- getCurrentDirectory
1315 let ioScript s = top</>"IO"</>s
1416 runCmd "git submodule init"
15− runCmd "npm install jsdom"
17+ out <- readProcess "npm" ["ls", "--parseable"] ""
18+ unless ("jsdom" `isInfixOf` out) $ runCmd "npm install jsdom"
1619 setCurrentDirectory $ top</>"tests"</>"elm"
1720 runCmd $ concat [top</>"dist"</>"build"</>"elm"</>"elm --make --only-js --src-dir=" , top</>"automaton", " --src-dir=", top</>"IO", " --src-dir=", top</>"Elm-Test", " Test.elm"]
1821 runCmd $ unwords ["cat ", ioScript "prescript.js", Elm.runtime, "build"</>"Test.js", ioScript "handler.js", "> exe.js"]