瀏覽代碼

Remove worktree dir before add

bryan 5 天之前
父節點
當前提交
35ec2993cc
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      openwrtbuilder

+ 2 - 0
openwrtbuilder

@@ -536,6 +536,8 @@ from_source() {
     execute git -C "$WORKTREE_DIR" checkout "$wt_commit"
     execute git -C "$WORKTREE_DIR" pull
   else
+    [[ -d "$WORKTREE_DIR" ]] && execute rm -rf "$WORKTREE_DIR"
+    [[ -d "$worktree_meta" ]] && execute rm -rf "$worktree_meta"
     execute git -C "$SRC_DIR" worktree add --force --force --detach "$WORKTREE_DIR" "$wt_commit"
   fi