JisolGame/CocosConfig - 副本.bat
PC-20230316NUNE\Administrator 6be5ebf5ea 提交
2024-01-06 19:18:02 +08:00

24 lines
1.1 KiB
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off & setlocal enabledelayedexpansion
@REM 需要被替换的字符串,注意字符串前后不加“”,支持空格
set var1={ this.baseAttributes = []; for(let _ele of _json_.baseAttributes) { let _e; { _e = []; for(let _ele of _ele) { let _e; _e = new TbGEntity.TAttributeValue(_ele); _e.push(_e);}}; this.baseAttributes.push(_e);}}
@REM 替换成什么内容,此处是批处理当前路径
set var2={ this.baseAttributes = []; for(let _ele of _json_.baseAttributes) { let _e; { _e = []; for(let _ele of _ele) { let _e; _e = new TbGEntity.TAttributeValue(_ele); _e.push(_e);}}; this.baseAttributes.push(_e);}}
for /r %%i in (JisolGameCocos\assets\script\config\data\schema.ts) do (
echo %%i
@REM 读取a.txt所有内容
for /f "eol=* tokens=*" %%j in (%%i) do (
@REM 设置变量a为每行内容
set a=%%j
@REM 如果该行有var1则将其改为var2
set "a=!a:%var1%=%var2%!"
echo !a!
@REM 把修改后的全部行存入$
echo !a!>>$
)
@REM 用$的内容替换原来a.txt内容
move $ %%i
)
pause