-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.fsx
48 lines (39 loc) · 1.22 KB
/
build.fsx
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
37
38
39
40
41
42
43
44
45
46
47
48
// include Fake lib
#I "packages/FAKE/tools/"
#r "FakeLib.dll"
open Fake
open Razhel.Configuration
#load "razhel.fsx"
let title = "Razhel"
let description = "Static website generator"
let config =
{
SourceDir = __SOURCE_DIRECTORY__ </> "src"
OutputDir = __SOURCE_DIRECTORY__ </> "docs"
BaseUrl = "/"
CopyDirs = ["img";"css";"js"]
}
// Targets
Target "?" (fun _ ->
printfn " *********************************************************"
printfn " * Available options (call 'build <Target>') *"
printfn " *********************************************************"
printfn " [Build]"
printfn " > Clean"
printfn " > Generate"
printfn " > Run"
printfn " "
printfn " [Help]"
printfn " > ?"
printfn " "
printfn " *********************************************************"
)
let setBaseUrl config =
match getBuildParam "baseUrl" with
| "" | null -> config
| url -> { config with BaseUrl = url }
Target "Clean" (fun _ -> Razhel.clean config |> ignore)
Target "Generate" (fun _ -> config |> setBaseUrl |> Razhel.generate |> ignore)
Target "Run" (fun _ -> config |> setBaseUrl |> Razhel.run)
// start build
RunTargetOrDefault "?"