美文网首页
蹩脚的Java补丁文件夹、文件目录树生成脚本

蹩脚的Java补丁文件夹、文件目录树生成脚本

作者: yahzon | 来源:发表于2019-05-12 15:29 被阅读0次

自己凑合写的,没办法,没用Maven自动发布。每次自己做补丁包,创建目录也是麻烦。用脚本少点几次鼠标吧。

@echo off
rem 创建日期\项目名\WEB-INF\classes\com.lxhg.xxx格式的目录
rem 基本配置信息

set path_home=F:\Project\back

if exist %path_home% goto okHome
md %path_home%
:okHome
f:
cd %path_home%

rem create folder using date as name
set "ymd=%date:~,4%%date:~5,2%%date:~8,2%"
if exist %ymd% goto okDate
md %ymd%
:okDate
cd %ymd%
set /p project_name=input your project name:
echo your project name is %project_name%
if exist %project_home% goto okProject
md %project_name%
:okProject
cd %project_name%
set project_home=%path_home%\%ymd%\%project_name%
echo %project_home%

rem 进入项目根目录准备创建com\lxhg\xxx目录层次
cd %project_home%
if exist WEB-INF goto okINF
md WEB-INF
:okINF
cd WEB-INF
if exist classes goto okCLASSES
md classes
:okCLASSES
cd classes
set /p package_name=input your package name:
echo pwd
echo your project name is %package_name%

rem 切割输入的包名com.lxhg.ufshop需要切割成com lxhg ufshop
set string=%package_name%
:split
for /f "tokens=1,* delims=." %%i in ("%string%") do (
  echo %%i
  md %%i
  cd %%i
  set string=%%j
)
if not "%string%"=="" goto split
cd %project_home%
pause

相关文章

网友评论

      本文标题:蹩脚的Java补丁文件夹、文件目录树生成脚本

      本文链接:https://www.haomeiwen.com/subject/mhpcaqtx.html