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"
60 , "Control.Biapplicative"
69 , "Control.Monad.Eff.Class"
70 , "Control.Monad.Eff.Console"
71 , "Control.Monad.Eff.Unsafe"
72 , "Control.Monad.Rec.Class"
77 , "Control.Semigroupoid"
79 , "Data.Array.Partial"
81 , "Data.Array.ST.Iterator"
84 , "Data.Bifunctor.Clown"
85 , "Data.Bifunctor.Flip"
86 , "Data.Bifunctor.Join"
87 , "Data.Bifunctor.Joker"
88 , "Data.Bifunctor.Product"
89 , "Data.Bifunctor.Wrap"
90 , "Data.Bitraversable"
92 , "Data.BooleanAlgebra"
95 , "Data.CommutativeRing"
97 , "Data.Either.Nested"
99 , "Data.EuclideanRing"
103 , "Data.Function.Uncurried"
105 , "Data.Functor.Invariant"
108 , "Data.Generic.Rep.Eq"
109 , "Data.Generic.Rep.Monoid"
110 , "Data.Generic.Rep.Ord"
111 , "Data.Generic.Rep.Semigroup"
112 , "Data.Generic.Rep.Show"
113 , "Data.HeytingAlgebra"
119 , "Data.Monoid.Additive"
120 , "Data.Monoid.Alternate"
125 , "Data.Monoid.Multiplicative"
126 , "Data.NaturalTransformation"
137 , "Data.String.CaseInsensitive"
138 , "Data.String.Regex"
139 , "Data.String.Regex.Flags"
140 , "Data.String.Regex.Unsafe"
141 , "Data.String.Unsafe"
145 , "Data.Tuple.Nested"
153 , "Type.Data.Ordering"
161pushd :: forall a. FilePath -> IO a -> IO a
163 original <- getCurrentDirectory
164 setCurrentDirectory dir
165 result <- try act :: IO (Either IOException a)
166 setCurrentDirectory original
167 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