فهرست منبع

improve checkupdate

ruki 1 سال پیش
والد
کامیت
3e6d34e834
2فایلهای تغییر یافته به همراه7 افزوده شده و 3 حذف شده
  1. 3 3
      scripts/autoupdate.lua
  2. 4 0
      scripts/checkupdate.lua

+ 3 - 3
scripts/autoupdate.lua

@@ -84,9 +84,9 @@ function _update_version(instance, version, shasum)
             instance:name(), version_current, version)
             instance:name(), version_current, version)
         os.vexec("git add .")
         os.vexec("git add .")
         os.vexec("git commit -a -m \"Update %s to %s\"", instance:name(), version)
         os.vexec("git commit -a -m \"Update %s to %s\"", instance:name(), version)
-        --os.vexec("git push %s %s:%s", repourl, branch, branch)
-        --os.vexec("gh pr create --label \"auto-update\" --title \"Auto-update %s to %s\" --body \"%s\" -R xmake-io/xmake-repo -B dev -H %s",
-        --    instance:name(), version, body, branch)
+        os.vexec("git push %s %s:%s", repourl, branch, branch)
+        os.vexec("gh pr create --label \"auto-update\" --title \"Auto-update %s to %s\" --body \"%s\" -R xmake-io/xmake-repo -B dev -H %s",
+            instance:name(), version, body, branch)
     end
     end
     os.vexec("git reset --hard HEAD")
     os.vexec("git reset --hard HEAD")
     os.vexec("git checkout %s", branch_current)
     os.vexec("git checkout %s", branch_current)

+ 4 - 0
scripts/checkupdate.lua

@@ -85,7 +85,11 @@ function _check_version_from_github_releases(package, url)
             local version_latest
             local version_latest
             for _, line in ipairs(list:split("\n")) do
             for _, line in ipairs(list:split("\n")) do
                 local splitinfo = line:split("%s+")
                 local splitinfo = line:split("%s+")
+                local release = splitinfo[1]
                 local version = splitinfo[#splitinfo - 1]
                 local version = splitinfo[#splitinfo - 1]
+                if not version or not _is_valid_version(version) and _is_valid_version(release) then
+                    version = release
+                end
                 if version and _is_valid_version(version) then
                 if version and _is_valid_version(version) then
                     version_latest = version
                     version_latest = version
                     break
                     break