forked from NewLifeX/X
-
Notifications
You must be signed in to change notification settings - Fork 0
/
更新基础.bat
71 lines (61 loc) · 1.49 KB
/
更新基础.bat
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
68
69
70
71
:: 新项目需要引用一些基础文件,包括:
:: 1,部署基本环境,根目录文件web.config,favicon.ico,Global.asax,index.htm
:: 2,对比更新Web\App_Code,Web\Admin,Css和Scripts
:: 3,引用文件DLL
@echo off
cls
setlocal enabledelayedexpansion
title 更新基础文件
:: 导出来源地址
:: 为了提高速度,可以采用本地地址
set svn=https://svn.newlifex.com/svn/X/trunk
if exist C:\X (
:: 先更新一次源
svn info %svn%/DLL
svn update C:\X\DLL
svn info %svn%/Src/Web
svn update C:\X\Src\Web
set svn=C:\X
)
set url=%svn%/trunk
:: 1,部署基本环境
if not exist Web md Web
if not exist WebData md WebData
:: 保存当前目录,并切换目录
pushd Web
set url=%svn%/Src/Web
:: do else 等关键字前后都应该预留空格
for %%i in (Web.config Default.aspx Default.aspx.cs favicon.ico Global.asax index.htm) do (
if not exist %%i svn export --force %url%/%%i %%i
)
:: 2,对比更新Web\App_Code,Web\Admin,Css和Scripts
set url=%svn%/Src/Web
for %%i in (App_Code Admin Css Scripts) do (
if exist %%i (
pushd %%i
for /r %%f in (*.*) do (
set name=%%f
set name=!name:%cd%\%%i\=!
::echo !name!
svn export --force %url%/%%i/!name:\=/! !name!
)
popd
) else (
svn export --force %url%/%%i %%i
)
)
:: 恢复目录
popd
:: 3,引用文件DLL
set name=DLL
set url=%svn%/%name%
if exist %name% (
pushd %name%
for /r %%f in (*.*) do svn export --force %url%/%%~nxf %%~nxf
popd
) else (
svn export --force %url% %name%
)
set name=更新基础.bat
svn export --force %svn%/Src/%name% %name%
pause