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]
56 [ "Control.Applicative"
60 , "Control.Monad.Eff.Class"
61 , "Control.Monad.Eff.Console"
62 , "Control.Monad.Eff.Unsafe"
66 , "Control.Semigroupoid"
68 , "Data.BooleanAlgebra"
70 , "Data.CommutativeRing"
72 , "Data.EuclideanRing"
74 , "Data.Function.Uncurried"
77 , "Data.HeytingAlgebra"
78 , "Data.NaturalTransformation"
95pushd :: forall a. FilePath -> IO a -> IO a
97 original <- getCurrentDirectory
98 setCurrentDirectory dir
99 result <- try act :: IO (Either IOException a)
100 setCurrentDirectory original
101 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