-
Notifications
You must be signed in to change notification settings - Fork 0
/
hake.hs
36 lines (28 loc) · 875 Bytes
/
hake.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE UnicodeSyntax #-}
import Hake
import Data.List
import Data.Foldable (for_)
main ∷ IO ()
main = hake $ do
"clean | clean the project" ∫ do
idris2 ["--clean"]
cwd <- getCurrentDirectory
all <- getDirectoryContents cwd
let html = filter (isSuffixOf ".html") all
for_ html $ removeIfExists
bishExecutable ♯
idris2 ["--build", "BiSH.ipkg"]
"run | run BiSH" ◉ [bishExecutable] ∰
rawSystem bishExecutable []
>>= checkExitCode
where
appName ∷ String
appName = "BiSH"
buildPath ∷ String
buildPath = "build" </> "exec"
bishExecutable ∷ String
bishExecutable =
{- HLINT ignore "Redundant multi-way if" -}
if | os ∈ ["win32", "mingw32", "cygwin32"] → buildPath </> appName ++ "exe"
| otherwise → buildPath </> appName