让发版更容易--增量包批处理命令1.2

该版本的批处理命令,加入了目录支持

1、脚本down.bat

@echo off&setlocal enabledelayedexpansion
rem [email protected] 2012-11-15
set BTFF_HOME=D:\software\apache-tomcat-6.0.29-2\webapps
set CONF_FILE=upf.conf
set CURRENT_PATH=%cd%

echo.
echo =====================================
echo.
echo    down btff.
echo.
echo    BTFF_HOME=%BTFF_HOME%
echo    DEST_DIR=%DEST_DIR%
echo    CONF_FILE=%CONF_FILE%
echo.
echo =====================================

rem Determine if the BTFF_HOME directory exists
if not exist "%BTFF_HOME%" (
	echo BTFF_HOME is not exist.
)

rem Determine if the config file exists
if not exist "%CONF_FILE%" (
	echo configfile miss: 
	echo   "%CURRENT_PATH%\%CONF_FILE%" is not exist.
) else (
    for /f "eol=# " %%i in (%CONF_FILE%) do (
		set ff=%%i
		set dd=%%~pi
		set ff=!ff:/=\!
		if not exist "!dd!" (
			mkdir "!dd!" > nul
		)
		copy "%BTFF_HOME%\!ff!" "!dd!" > nul
		if !errorlevel!==0 ( set res=......ok. )
		echo !ff!!res!
	)
)

rem tree /f BTFF
:exit
echo finish.
pause

2、资源文件upf.conf

BTFF/WEB-INF/classes/cn/xxx/yyyy/zzzz/dao/PhoneDao.class
BTFF/WEB-INF/classes/cn/xxx/yyyy/zzzz/dao/PhoneDao.xml
BTFF/WEB-INF/classes/cn/xxx/yyyy/zzzz/service/impl/*


 如上,与上一版本相比,本版本使用时,只需要再将需要更新的文件目录后加一个/*即可,这样就能将该目录下的所有文件(包含其子目录下的文件,且不限制目录级数)

拷贝出来,以方便增量升级使用。

 

 

 

 

 

 

你可能感兴趣的:(让发版更容易--增量包批处理命令1.2)