From bec23beb3391023d478ba30345106b40977c956a Mon Sep 17 00:00:00 2001 From: Foldcc_b1 Date: Thu, 13 Mar 2025 18:16:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0Upm.bat=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=BC=BA=E9=94=99=E8=AF=AF=E5=A4=84=E7=90=86?= =?UTF-8?q?=E5=92=8C=E5=88=86=E6=94=AF=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=8C=E7=A1=AE=E4=BF=9D=E5=9C=A8=E5=88=9B=E5=BB=BAupm?= =?UTF-8?q?=E5=88=86=E6=94=AF=E6=97=B6=E6=A3=80=E6=9F=A5Assets=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B9=E7=9A=84=E5=AD=98=E5=9C=A8=E6=80=A7=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E5=B0=86=E7=89=88=E6=9C=AC=E5=8F=B7=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E8=87=B31.3.7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/package.json | 2 +- Update Upm.bat | 46 ++++++++++++++++++++++++++++++++++++--------- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/Assets/package.json b/Assets/package.json index 68e8d2b..5775a1f 100644 --- a/Assets/package.json +++ b/Assets/package.json @@ -2,7 +2,7 @@ "name": "com.commercialization.topon", "displayName": "Commercialization.topon", "description": "基于topon的广告sdk封装,依赖基础商业化模块", - "version": "1.3.6", + "version": "1.3.7", "unity": "2021.1", "license": "MIT", "repository": { diff --git a/Update Upm.bat b/Update Upm.bat index 2f6c0c8..18af797 100644 --- a/Update Upm.bat +++ b/Update Upm.bat @@ -31,27 +31,54 @@ set /p Flg=确认提交的版本号%version%,是否开始提交(y/n) -------- IF "%Flg%" equ "y" ( echo 开始提交,请勿关闭该窗口! - :: Force switch to master first + :: Force switch to master first and ensure clean state + echo 切换到master分支并清理工作区... git checkout -f master + git reset --hard HEAD + git clean -fd - :: Delete local upm branch if exists - git branch -D upm 2>nul - - :: Create new upm branch from current Assets folder - git subtree split --prefix=Assets --branch upm - if %errorlevel% neq 0 ( - echo 错误:创建upm分支失败! + :: Verify Assets folder exists + if not exist "Assets" ( + echo 错误:Assets文件夹不存在! goto :END ) + :: Delete local upm branch if exists + echo 清理本地upm分支... + git branch -D upm 2>nul + + :: Create new upm branch from current Assets folder with verbose output + echo 正在创建upm分支... + git subtree split --prefix Assets --branch upm --verbose + if %errorlevel% neq 0 ( + echo 错误:创建upm分支失败! + echo 正在尝试修复... + + :: Try to fix common issues + git gc + git prune + + :: Second attempt + echo 第二次尝试创建upm分支... + git subtree split --prefix Assets --branch upm --verbose + if %errorlevel% neq 0 ( + echo 错误:创建upm分支失败,请确保: + echo 1. Assets文件夹存在且不为空 + echo 2. 当前分支没有未提交的更改 + echo 3. Git仓库状态正常 + goto :END + ) + ) + :: Force update local upm branch with remote changes + echo 更新远程upm分支... git fetch origin upm git checkout -f upm git reset --hard origin/upm :: Create new subtree split git checkout -f master - git subtree split --prefix=Assets --branch upm-temp + git subtree split --prefix Assets --branch upm-temp :: Apply new changes and force push git checkout -f upm @@ -88,6 +115,7 @@ IF "%Flg%" equ "y" ( :: Return to master branch git checkout -f master + echo 所有操作已完成! ) :END