Skip to content

Commit ce48a6f

Browse files
committed
Update install.lua
1 parent b4421be commit ce48a6f

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

install.lua

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ local function movefilesinfolder(src, dest, callback)
2626

2727
end
2828

29-
local function checkfilesexists(archivefile)
30-
if os.exists(archivefile .. '.list') then
31-
local installedlistfile = io.open(archivefile .. '.list', "r")
29+
local function checkfilesexists(listfile)
30+
if os.exists(listfile) then
31+
local installedlistfile = io.open(listfile, "r")
3232
if nil == installedlistfile then
33-
print("open file: " .. archivefile .. '.list' .. " fail")
33+
print("open file: " .. listfile .. " fail")
3434
return
3535
end
3636
while (true) do
@@ -47,10 +47,11 @@ end
4747
function main()
4848

4949
local name = "leetcode-treenode-cpp"
50-
local version = "1.1.8"
50+
local version = "1.1.9"
5151
local folder = name .. "-" .. version
5252
local archivefile = path.join('downloads', folder .. '.tar.gz')
53-
if checkfilesexists(archivefile) then return end
53+
local listfile = path.join('downloads', folder .. '.list')
54+
if checkfilesexists(listfile) then return end
5455
if not os.exists(archivefile) then
5556
local url = 'https://ghproxy.com/https://github.com/masx200/' .. name ..
5657
'/archive/' .. version .. '.tar.gz'
@@ -69,15 +70,15 @@ function main()
6970
print("remove folder:" .. name)
7071
os.rmdir(name)
7172
end
72-
local installedlistfile = io.open(archivefile .. '.list', "w")
73+
local installedlistfile = io.open(listfile, "w")
7374
if nil == installedlistfile then
74-
print("open file: " .. archivefile .. '.list' .. " fail")
75+
print("open file: " .. listfile .. " fail")
7576
return
7677
end
7778
movefilesinfolder(src, name, function(installedfile)
7879
installedlistfile:write(installedfile)
7980
installedlistfile:write("\n")
8081
end)
8182
installedlistfile:close()
82-
print("save installedlistfile to " .. archivefile .. '.list')
83+
print("save installedlistfile to " .. listfile)
8384
end

0 commit comments

Comments
 (0)