Skip to content

Commit

Permalink
Update install.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
masx200 committed May 15, 2023
1 parent f60ee39 commit 9fb368a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions install.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,32 @@ local function movefilesinfolder(src, dest, callback)
end

end

local function checkfilesexists(archivefile)
if os.exists(archivefile .. '.list') then
local installedlistfile = io.open(archivefile .. '.list', "r")
if nil == installedlistfile then
print("open file: " .. archivefile .. '.list' .. " fail")
return
end
while (true) do
local content2 = installedlistfile:read("*l")

if content2 == nil then return true end

if not os.exists(content2) then return false end

end
end
return false
end
function main()

local name = "leetcode-treenode-cpp"
local version = "1.1.8"
local folder = name .. "-" .. version
local archivefile = path.join('downloads', folder .. '.tar.gz')
if checkfilesexists(archivefile) then return end
if not os.exists(archivefile) then
local url = 'https://ghproxy.com/https://github.com/masx200/' .. name ..
'/archive/' .. version .. '.tar.gz'
Expand Down

0 comments on commit 9fb368a

Please sign in to comment.