diff --git a/scripts/autoupdate.lua b/scripts/autoupdate.lua index 769c5f0d1..7934e6c6d 100644 --- a/scripts/autoupdate.lua +++ b/scripts/autoupdate.lua @@ -69,8 +69,8 @@ function _update_version(instance, version, shasum) os.vexec("git checkout %s", branch) local inserted = false local scriptfile = path.join(instance:scriptdir(), "xmake.lua") + local version_current if os.isfile(scriptfile) then - local version_current io.gsub(scriptfile, "add_versions%(\"(.-)\",%s+\"(.-)\"%)", function (v, h) if not version_current or semver.compare(v, version_current) > 0 then version_current = v