add 项目运行截图
This commit is contained in:
47
bat/run_install_server.bat
Normal file
47
bat/run_install_server.bat
Normal file
@@ -0,0 +1,47 @@
|
||||
@echo off
|
||||
chcp 65001 >nul
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
:: 强制切换到脚本所在目录(解决管理员模式启动默认在System32的问题)
|
||||
cd /d "%~dp0"
|
||||
|
||||
echo 正确盘符: %~d0
|
||||
echo 正确路径: %cd%
|
||||
|
||||
:: 使用/d参数强制切换驱动器+目录
|
||||
cd /d "D:\code\server" 2>nul
|
||||
if %errorlevel% neq 0 (
|
||||
echo [ERROR] Can not enter D:\code\server
|
||||
echo 请检查:
|
||||
echo 1. D盘是否存在
|
||||
echo 2. code目录是否存在
|
||||
echo 3. 是否有权限访问
|
||||
exit /b
|
||||
)
|
||||
|
||||
echo 扫描子目录中...
|
||||
dir /ad /b
|
||||
|
||||
set "first_dir="
|
||||
for /f "delims=" %%d in ('dir /ad /b 2^>nul') do (
|
||||
set "first_dir=%%d"
|
||||
goto :dir_found
|
||||
)
|
||||
|
||||
:dir_found
|
||||
if not defined first_dir (
|
||||
echo [ERROR] No subdirectory found
|
||||
exit /b
|
||||
)
|
||||
|
||||
echo 进入子目录: !first_dir!
|
||||
cd /d "!first_dir!"
|
||||
echo 当前路径: %cd%
|
||||
|
||||
if not exist "target\" (
|
||||
echo 执行Maven构建...
|
||||
call mvn clean package
|
||||
) else (
|
||||
pause
|
||||
echo 检测到 target 目录,跳过Maven构建。
|
||||
)
|
||||
Reference in New Issue
Block a user