Skip to content

Commit 9fb368a

Browse files
committed
Update install.lua
1 parent f60ee39 commit 9fb368a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

install.lua

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,32 @@ local function movefilesinfolder(src, dest, callback)
2525
end
2626

2727
end
28+
29+
local function checkfilesexists(archivefile)
30+
if os.exists(archivefile .. '.list') then
31+
local installedlistfile = io.open(archivefile .. '.list', "r")
32+
if nil == installedlistfile then
33+
print("open file: " .. archivefile .. '.list' .. " fail")
34+
return
35+
end
36+
while (true) do
37+
local content2 = installedlistfile:read("*l")
38+
39+
if content2 == nil then return true end
40+
41+
if not os.exists(content2) then return false end
42+
43+
end
44+
end
45+
return false
46+
end
2847
function main()
2948

3049
local name = "leetcode-treenode-cpp"
3150
local version = "1.1.8"
3251
local folder = name .. "-" .. version
3352
local archivefile = path.join('downloads', folder .. '.tar.gz')
53+
if checkfilesexists(archivefile) then return end
3454
if not os.exists(archivefile) then
3555
local url = 'https://ghproxy.com/https://github.com/masx200/' .. name ..
3656
'/archive/' .. version .. '.tar.gz'

0 commit comments

Comments
 (0)