1
1
mirror of https://github.com/aelve/guide.git synced 2024-12-25 13:51:45 +03:00
guide/Setup.hs

22 lines
607 B
Haskell
Raw Normal View History

2016-02-02 12:35:39 +03:00
import Distribution.Simple
import System.Process
2017-08-19 18:13:24 +03:00
import System.Environment (lookupEnv)
main = do
2017-08-19 18:13:24 +03:00
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" ["./scripts/buildjs.sh"]
(_, _, _, buildHandle) <- createProcess npmbuild
waitForProcess buildHandle
originalPostBuild args flags pkgDesc localBuildInfo
}