Skip to content

Commit 664eecf

Browse files
committed
fix: 修复脚本4更新代码时缺少fetch步骤
1 parent 7c47cad commit 664eecf

2 files changed

Lines changed: 22 additions & 21 deletions

File tree

desktop_qt_ui/editor/editor_controller.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,9 +1350,6 @@ def delete_regions(self, region_indices: list):
13501350

13511351
# 清除选择
13521352
self.model.set_selection([])
1353-
1354-
except Exception as e:
1355-
self.logger.error(f"[DELETE] 删除区域时发生错误: {e}", exc_info=True)
13561353

13571354
def enter_drawing_mode(self):
13581355
"""进入绘制模式以添加新文本框"""

步骤4-更新维护.bat

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -233,20 +233,22 @@ echo.
233233

234234
echo [警告] 将强制同步到远程分支,本地修改将被覆盖
235235
set /p confirm="是否继续更新? (y/n): "
236-
if /i not "!confirm!"=="y" (
237-
echo 取消更新
238-
goto menu
239-
)
236+
if /i not "!confirm!"=="y" goto :update_code_cancel
237+
238+
echo.
239+
echo 获取远程更新...
240+
"!GIT!" fetch origin
240241

241242
echo.
242243
echo 正在强制同步到远程分支...
243-
"%GIT%" reset --hard origin/main
244+
"!GIT!" reset --hard origin/main && echo [OK] 代码更新完成 && goto :update_code_done
245+
echo [ERROR] 代码更新失败
246+
goto :update_code_done
244247

245-
if %ERRORLEVEL% == 0 (
246-
echo [OK] 代码更新完成
247-
) else (
248-
echo [ERROR] 代码更新失败
249-
)
248+
:update_code_cancel
249+
echo 取消更新
250+
251+
:update_code_done
250252
pause
251253
goto menu
252254

@@ -298,18 +300,20 @@ if /i not "!confirm!"=="y" (
298300

299301
echo.
300302
echo 获取远程更新...
301-
"%GIT%" fetch origin
303+
"!GIT!" fetch origin
302304

303305
echo.
304306
echo 正在强制同步到远程分支...
305-
"%GIT%" reset --hard origin/main
306-
307-
if %ERRORLEVEL% neq 0 (
308-
echo [ERROR] 代码更新失败
309-
pause
310-
goto menu
311-
)
307+
"!GIT!" reset --hard origin/main || goto :full_update_code_failed
312308
echo [OK] 代码更新完成
309+
goto :full_update_deps
310+
311+
:full_update_code_failed
312+
echo [ERROR] 代码更新失败
313+
pause
314+
goto menu
315+
316+
:full_update_deps
313317

314318
echo.
315319
echo [2/2] 更新依赖...

0 commit comments

Comments
 (0)