git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Run bower thru node(js) executable
commit9d653a7b5376cfeda66e33ad70857dc600f4f743 authorOleg Grenrus <oleg.grenrus@iki.fi> dateSun 5 Jun 2016, 13:02 (10 years ago) parent3154b24
1 file changed+10−1
tests/TestUtils.hs+10−1
tests/TestUtils.hs+10−1
@@ -12,6 +12,8 @@ import Control.Exception
1212import System.Process
1313import System.Directory
1414import System.Info
15+import System.Exit (exitFailure)
16+import System.IO (stderr, hPutStrLn)
1517
1618findNodeProcess :: IO (Maybe String)
1719findNodeProcess = runMaybeT . msum $ map (MaybeT . findExecutable) names
@@ -33,10 +35,17 @@ updateSupportCode = do
3335 then callProcess "setup-win.cmd" []
3436 else do
3537 callProcess "npm" ["install"]
38+ -- bower uses shebang "/usr/bin/env node", but we might have nodejs
39+ node <- maybe cannotFindNode pure =<< findNodeProcess
3640 -- Sometimes we run as a root (e.g. in simple docker containers)
3741 -- And we are non-interactive: https://github.com/bower/bower/issues/1162
38− callProcess "node_modules/.bin/bower" ["--allow-root", "install", "--config.interactive=false"]
42+ callProcess node ["node_modules/.bin/bower", "--allow-root", "install", "--config.interactive=false"]
3943 setCurrentDirectory "../.."
44+ where
45+ cannotFindNode :: IO a
46+ cannotFindNode = do
47+ hPutStrLn stderr "Cannot find node (or nodejs) executable"
48+ exitFailure
4049
4150-- |
4251-- The support modules that should be cached between test cases, to avoid