lingsuanClient/protobuf/proto2CNet_Server.bat

30 lines
745 B
Batchfile
Raw Normal View History

2025-06-07 17:07:13 +08:00
:: 修改后的脚本主要调整OUT_PATH部分
cd ./proto/
del ..\protoGen\Proto\*.proto
copy *.proto ..\protoGen\Proto\
cd ..\protoGen
del .\ProtoOut\*.cs
dir .\Proto\*.proto /b > protolist.txt
for /f "delims=." %%i in (protolist.txt) do (
if not "%%i"=="client_msg" if not "%%i"=="client_msg_enum" (
protogen -i:./Proto/%%i.proto -o:./ProtoOut/%%i.cs -ns:CusProtobuf -p:detectMissing
)
)
cd ./ProtoOut
:: 关键修改:计算相对路径(假设脚本根目录为 F:\lingsuan\main\protobuf
set OUT_PATH=..\..\..\%protobuf_server
:: 确保目标目录存在
if not exist "%OUT_PATH%" mkdir "%OUT_PATH%"
copy *.cs %OUT_PATH%
del ..\..\protolist.txt
:: 打开导出的目录文件夹
start "" "%OUT_PATH%"
exit