From 2b837d83db92f24f589edf9f078d13dff746522a Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 11 Jan 2024 00:54:37 +0800 Subject: [PATCH] try remove branch --- scripts/autoupdate.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/autoupdate.lua b/scripts/autoupdate.lua index 265124fe3..a4e40a0e7 100644 --- a/scripts/autoupdate.lua +++ b/scripts/autoupdate.lua @@ -42,7 +42,7 @@ function _update_version(instance, version, shasum) local branch_current = os.iorun("git branch --show-current"):trim() local repourl = "https://github.com/xmake-io/xmake-repo.git" os.vexec("git reset --hard HEAD") - os.vexec("git branch -D %s", branch) + os.execv("git", {"branch", "-D", branch}, {try = true}) os.vexec("git checkout dev") os.vexec("git pull %s dev", repourl) os.vexec("git branch %s", branch) @@ -51,6 +51,7 @@ function _update_version(instance, version, shasum) local remote_branches = os.iorun("git ls-remote --head %s", repourl) if remote_branches then for _, remote_branch in ipairs(remote_branches:split("\n")) do + remote_branch = remote_branch:split("%s")[2] if remote_branch == "refs/heads/" .. branch then is_pending = true break