-
Notifications
You must be signed in to change notification settings - Fork 1
/
publish.cmd
56 lines (40 loc) · 999 Bytes
/
publish.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
@echo off
SET PATH=%PATH%;C:\Program Files\Git\usr\bin;
SET srcDir=%cd%
set dstx=%srcDir%-%RANDOM%
FOR /F "tokens=* USEBACKQ" %%F IN (`git rev-parse HEAD`) DO (
SET master-sha=%%F
)
set dst=%dstx%\publish
set dsttmp=%dstx%\temp
set dst2=%dst%\wwwroot
md %dst2%
md %dsttmp%
git branch gh-pages origin/gh-pages
git clone --separate-git-dir=%dst2%\.git -l -b gh-pages . %dsttmp%
cd src
dotnet clean
cd RegexTesterBlazorClientSide
dotnet clean
rd /s /q bin
rd /s /q obj
dotnet publish -c Release -o %dst%
cd %dst2%
del *.log /S
echo *.* binary > %dst2%\.gitattributes
echo %master-sha% > %dst2%\version.txt
git ls-files --deleted -z | xargs -0 git rm
git add -u -f :/
git add -f :/
git commit -m "Built %master-sha%" --allow-empty
TortoiseGitProc.exe /command:repostatus
git gui
pause
git push origin gh-pages:gh-pages
cd ..
mklink /D /J regex-tester wwwroot
start http-server
start chrome --guest http://localhost:8080/regex-tester
cd %srcDir%
gitk HEAD gh-pages
rem rd /s /q %dstx%