1
1
mirror of https://github.com/aelve/guide.git synced 2024-11-26 12:42:30 +03:00
guide/back/Setup.hs
2018-12-09 23:02:03 +01:00

22 lines
599 B
Haskell

import Distribution.Simple
import System.Process
import System.Environment (lookupEnv)
main = do
js <- lookupEnv "NO_JS"
case js of
Just "true" -> defaultMain
_ -> do
hooks <- buildJS simpleUserHooks
defaultMainWithHooks hooks
buildJS hooks = do
let originalPostBuild = postBuild hooks
return $ hooks {
postBuild = \args flags pkgDesc localBuildInfo -> do
let npmbuild = proc "sh" ["./buildjs.sh"]
(_, _, _, buildHandle) <- createProcess npmbuild
waitForProcess buildHandle
originalPostBuild args flags pkgDesc localBuildInfo
}