1-----------------------------------------------------------------------------
4-- License : MIT (http://opensource.org/licenses/MIT)
6-- Maintainer : Phil Freeman <paf31@cantab.net>
7-- Stability : experimental
12-----------------------------------------------------------------------------
13{-# LANGUAGE ScopedTypeVariables #-}
20import Data.Maybe (fromMaybe)
22import Control.Monad.Trans.Maybe
23import Control.Exception
26import System.Directory
29import Language.PureScript.Crash
31findNodeProcess :: IO (Maybe String)
32findNodeProcess = runMaybeT . msum $ map (MaybeT . findExecutable) names
34 names = ["nodejs", "node"]
37-- Fetches code necessary to run the tests with. The resulting support code
38-- should then be checked in, so that npm/bower etc is not required to run the
41-- Simply rerun this (via ghci is probably easiest) when the support code needs
44updateSupportCode :: IO ()
46 node <- fromMaybe (internalError "cannot find node executable") <$> findNodeProcess
47 setCurrentDirectory "tests/support"
48 if System.Info.os == "mingw32"
49 then callProcess "setup-win.cmd" []
51 callProcess "npm" ["install"]
52 -- Sometimes we run as a root (e.g. in simple docker containers)
53 -- And we are non-interactive: https://github.com/bower/bower/issues/1162
54 callProcess "node_modules/.bin/bower" ["--allow-root", "install", "--config.interactive=false"]
55 callProcess node ["setup.js"]
56 setCurrentDirectory "../.."
58pushd :: forall a. FilePath -> IO a -> IO a
60 original <- getCurrentDirectory
61 setCurrentDirectory dir
62 result <- try act :: IO (Either IOException a)
63 setCurrentDirectory original
64 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