1{-# LANGUAGE ScopedTypeVariables #-}
9import Control.Monad.Trans.Maybe
10import Control.Exception
13import System.Directory
15import System.Exit (exitFailure)
16import System.IO (stderr, hPutStrLn)
18findNodeProcess :: IO (Maybe String)
19findNodeProcess = runMaybeT . msum $ map (MaybeT . findExecutable) names
21 names = ["nodejs", "node"]
24-- Fetches code necessary to run the tests with. The resulting support code
25-- should then be checked in, so that npm/bower etc is not required to run the
28-- Simply rerun this (via ghci is probably easiest) when the support code needs
31updateSupportCode :: IO ()
33 setCurrentDirectory "tests/support"
34 if System.Info.os == "mingw32"
35 then callProcess "setup-win.cmd" []
37 callProcess "npm" ["install"]
38 -- bower uses shebang "/usr/bin/env node", but we might have nodejs
39 node <- maybe cannotFindNode pure =<< findNodeProcess
40 -- Sometimes we run as a root (e.g. in simple docker containers)
41 -- And we are non-interactive: https://github.com/bower/bower/issues/1162
42 callProcess node ["node_modules/.bin/bower", "--allow-root", "install", "--config.interactive=false"]
43 setCurrentDirectory "../.."
45 cannotFindNode :: IO a
47 hPutStrLn stderr "Cannot find node (or nodejs) executable"
51-- The support modules that should be cached between test cases, to avoid
52-- excessive rebuilding.
54supportModules :: [String]
57 , "Control.Alternative"
58 , "Control.Applicative"
67 , "Control.Monad.Eff.Class"
68 , "Control.Monad.Eff.Console"
69 , "Control.Monad.Eff.Unsafe"
74 , "Control.Semigroupoid"
76 , "Data.BooleanAlgebra"
78 , "Data.CommutativeRing"
80 , "Data.EuclideanRing"
83 , "Data.Function.Uncurried"
85 , "Data.Functor.Invariant"
87 , "Data.Generic.Rep.Monoid"
88 , "Data.Generic.Rep.Eq"
89 , "Data.Generic.Rep.Ord"
90 , "Data.Generic.Rep.Semigroup"
91 , "Data.HeytingAlgebra"
93 , "Data.Monoid.Additive"
98 , "Data.Monoid.Multiplicative"
99 , "Data.NaturalTransformation"
117pushd :: forall a. FilePath -> IO a -> IO a
119 original <- getCurrentDirectory
120 setCurrentDirectory dir
121 result <- try act :: IO (Either IOException a)
122 setCurrentDirectory original
123 either throwIO return result
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list