@@ -26,11 +26,11 @@ local function movefilesinfolder(src, dest, callback)
26
26
27
27
end
28
28
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" )
32
32
if nil == installedlistfile then
33
- print (" open file: " .. archivefile .. ' .list ' .. " fail" )
33
+ print (" open file: " .. listfile .. " fail" )
34
34
return
35
35
end
36
36
while (true ) do
47
47
function main ()
48
48
49
49
local name = " leetcode-treenode-cpp"
50
- local version = " 1.1.8 "
50
+ local version = " 1.1.9 "
51
51
local folder = name .. " -" .. version
52
52
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
54
55
if not os .exists (archivefile ) then
55
56
local url = ' https://ghproxy.com/https://github.com/masx200/' .. name ..
56
57
' /archive/' .. version .. ' .tar.gz'
@@ -69,15 +70,15 @@ function main()
69
70
print (" remove folder:" .. name )
70
71
os .rmdir (name )
71
72
end
72
- local installedlistfile = io.open (archivefile .. ' .list ' , " w" )
73
+ local installedlistfile = io.open (listfile , " w" )
73
74
if nil == installedlistfile then
74
- print (" open file: " .. archivefile .. ' .list ' .. " fail" )
75
+ print (" open file: " .. listfile .. " fail" )
75
76
return
76
77
end
77
78
movefilesinfolder (src , name , function (installedfile )
78
79
installedlistfile :write (installedfile )
79
80
installedlistfile :write (" \n " )
80
81
end )
81
82
installedlistfile :close ()
82
- print (" save installedlistfile to " .. archivefile .. ' .list ' )
83
+ print (" save installedlistfile to " .. listfile )
83
84
end
0 commit comments