summaryrefslogtreecommitdiff
path: root/xmake
diff options
context:
space:
mode:
authorruki <[email protected]>2020-02-16 12:04:11 +0800
committerruki <[email protected]>2020-02-16 12:04:15 +0800
commit0b07ecdf2dc3ccf2b2d73bc2017656b396f35571 (patch)
treec3efb8c47c702fe9005b368db884f61c583399b5 /xmake
parent941da42aca3e9af717c4bd789e1c5dd0409170dd (diff)
improve to update urls
Diffstat (limited to 'xmake')
-rw-r--r--xmake/actions/update/main.lua9
-rw-r--r--xmake/actions/update/xmake.lua1
2 files changed, 6 insertions, 4 deletions
diff --git a/xmake/actions/update/main.lua b/xmake/actions/update/main.lua
index 79ce6c7b1..13cb9592d 100644
--- a/xmake/actions/update/main.lua
+++ b/xmake/actions/update/main.lua
@@ -301,7 +301,7 @@ function main()
local is_official = fetchinfo.is_official
local mainurls = fetchinfo.urls
local version = fetchinfo.version
- if is_official and xmake.version():eq(version) then
+ if is_official and xmake.version():eq(version) and not option.get("force") then
cprint("${bright}xmake %s has been installed!", version)
return
end
@@ -314,10 +314,11 @@ function main()
end
if version:find('.', 1, true) then
+ local winarch = os.arch() == "x64" and "win64" or "win32"
mainurls = {format("https://ci.appveyor.com/api/projects/waruqi/xmake/artifacts/xmake-installer.exe?tag=%s&pr=false&job=Image%%3A+Visual+Studio+2017%%3B+Platform%%3A+%s", version, os.arch()),
- format("https://github.com/xmake-io/xmake/releases/download/%s/xmake-%s.exe", version, version),
- format("https://cdn.jsdelivr.net/gh/xmake-mirror/xmake-releases@master/xmake-%s.exe.zip", version),
- format("https://gitlab.com/xmake-mirror/xmake-releases/raw/master/xmake-%s.exe.zip", version)}
+ format("https://github.com/xmake-io/xmake/releases/download/%s/xmake-%s.%s.exe", version, version, winarch),
+ format("https://cdn.jsdelivr.net/gh/xmake-mirror/xmake-releases@%s/xmake-%s.%s.exe.zip", version, version, winarch),
+ format("https://gitlab.com/xmake-mirror/xmake-releases/raw/%s/xmake-%s.%s.exe.zip", version, version, winarch)}
else
-- regard as a git branch, fetch from ci
mainurls = {format("https://ci.appveyor.com/api/projects/waruqi/xmake/artifacts/xmake-installer.exe?branch=%s&pr=false&job=Image%%3A+Visual+Studio+2017%%3B+Platform%%3A+%s", version, os.arch())}
diff --git a/xmake/actions/update/xmake.lua b/xmake/actions/update/xmake.lua
index 74dcd0ba9..2f272dd07 100644
--- a/xmake/actions/update/xmake.lua
+++ b/xmake/actions/update/xmake.lua
@@ -41,6 +41,7 @@ task("update")
{nil, "uninstall", "k", nil, "Uninstall the current xmake program." }
, { }
, {'s', "scriptonly", "k", nil, "Update script only" }
+ , {'f', "force", "k", nil, "Force to update and reinstall the given version." }
, {nil, "xmakever", "v", nil, "The given xmake version, or a git source (and branch). ",
"e.g.",
" from official source: ",