/
firm.cmd
67 lines (58 loc) · 1.3 KB
/
firm.cmd
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
@echo off
setlocal
set root=%~dp0
if "%1"=="reset" goto :reset
if "%1"=="init" goto :init
if "%1"=="clean" goto :clean
if "%1"=="build" goto :build
if "%1"=="generate" goto :generate
if "%1"=="preview" goto :preview
goto :help
:reset
if exist packages (
echo Removing packages...
rd /q /s packages
)
if exist bin (
echo Removing bin...
rd /s /q bin
)
if exist output (
echo Removing output...
rd /s /q output
)
echo Done!
goto :end
:init
echo Initializing packages...
.paket\paket.exe restore
echo Done!
goto :end
:clean
:build
if not exist packages call :init
echo Calling FAKE with target "%1"...
packages\FAKE\tools\FAKE.exe fake.fsx %1
echo Done!
goto :end
:generate
if not exist bin call :build build
echo Generating site...
bin\Generator.exe "%root%"
goto :end
:preview
if not exist output call :generate
echo Starting HTTP server to preview site...
bin\Host.exe "%root%output\\"
echo Done!
goto :end
:help
echo Available commands:
echo reset Removes all downloaded and generated files/folders.
echo init Installs the required paket dependencies.
echo clean Cleans the build directory.
echo build Builds the firm application.
echo generate Generates the web site.
echo preview Starts a local http server for previewing the generated blog.
:end
endlocal