forked from re-zero-khis/re0-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ps1
More file actions
26 lines (20 loc) · 805 Bytes
/
build.ps1
File metadata and controls
26 lines (20 loc) · 805 Bytes
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
# Github Pages 要求所发布的 Html 路径不能有下划线,否则无法解析
# 此脚本的目的是把 GitBook 生成的 _book 目录复制到 book
Write-Output "Remove gitbook/_book ..."
Remove-Item gitbook/_book -recurse
Start-Sleep 1
Write-Output "Remove gitbook/book ..."
Remove-Item gitbook/book -recurse
Start-Sleep 1
If(!(Test-Path 'gitbook/node_modules')) {
echo "Download nodejs module ..."
git clone https://github.com/lyy289065406/node_modules gitbook/node_modules
Sleep 2
}
Write-Output "GitBook Building ..."
docker run --rm -v "$PWD/gitbook:/gitbook" expm02/gitbook-server gitbook build
Start-Sleep 2
Write-Output "Building for GitHub Pages ..."
Copy-Item gitbook/_book gitbook/book -recurse
Write-Output "Build Finish."
Write-Output "You can push to github now."