-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish.ps1
35 lines (28 loc) · 864 Bytes
/
publish.ps1
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
param (
[switch]$release
)
$ErrorActionPreference = "Stop"
git fetch origin gh-pages-release
if (-not (Test-Path package\.git)) {
Remove-Item package -Recurse -Force
git worktree add package origin/gh-pages-release
}
if (-not (Test-Path package\.git)) {
throw "Не могу продолжить работу без отдельного worktree в папке package";
}
Push-Location package
[environment]::CurrentDirectory = (Get-Location)
Remove-Item * -Recurse -Exclude .git
git checkout --force origin/gh-pages-release -B gh-pages
git rm execute-* -f
Pop-Location
[environment]::CurrentDirectory = (Get-Location)
node build
Push-Location package
[environment]::CurrentDirectory = (Get-Location)
git add .
git commit -m "publish"
git push origin gh-pages:gh-pages --force
if ($release) {
git push origin gh-pages:gh-pages-release
}