Skip to content

Commit 5b1f24c

Browse files
committed
use http.download_file
1 parent 69ce2cf commit 5b1f24c

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

lib/util.lua

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,13 @@ function windowsCompile(ctx)
5252
print("Downloading installer...")
5353
print("from:\t" .. url)
5454
print("to:\t" .. qInstallFile)
55-
local resp, err = http.get({
55+
local err = http.download_file({
5656
url = url,
5757
headers = REQUEST_HEADERS
58-
})
58+
}, qInstallFile)
5959

60-
if err ~= nil or resp.status_code ~= 200 then
60+
if err ~= nil then
6161
error("Downloading installer failed")
62-
else
63-
local file = io.open(qInstallFile, "w")
64-
file:write(resp.body)
65-
local size = file:seek("end")
66-
file:close()
67-
print("size:\t" .. size .. " bytes")
6862
end
6963

7064
-- Extract

metadata.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ NOTE:
2121
If the plugin is not compatible with the current vfox version,
2222
vfox will not load the plugin and prompt the user to upgrade vfox.
2323
--]]
24-
PLUGIN.minRuntimeVersion = "0.3.0"
24+
PLUGIN.minRuntimeVersion = "0.4.0"
2525
-- Some things that need user to be attention!
2626
PLUGIN.notes = {
2727
"Mirror Setting:",

0 commit comments

Comments
 (0)