mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 11:48:02 -04:00
Merge branch 'master' of github.com:MightyPirates/OpenComputers
This commit is contained in:
commit
672d9d6b83
@ -78,9 +78,9 @@ end
|
|||||||
|
|
||||||
local function downloadFile(url,path,force)
|
local function downloadFile(url,path,force)
|
||||||
if options.f or force then
|
if options.f or force then
|
||||||
wget("-fq",url,path)
|
return wget("-fq",url,path)
|
||||||
else
|
else
|
||||||
wget("-q",url,path)
|
return wget("-q",url,path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -349,7 +349,7 @@ local function installPackage(pack,path,update)
|
|||||||
end
|
end
|
||||||
if update then
|
if update then
|
||||||
term.write("Removing old files...")
|
term.write("Removing old files...")
|
||||||
for i,j in pairs(tPacks[pack]) do
|
for _,j in pairs(tPacks[pack]) do
|
||||||
fs.remove(j)
|
fs.remove(j)
|
||||||
end
|
end
|
||||||
term.write("Done.\n")
|
term.write("Done.\n")
|
||||||
@ -371,9 +371,18 @@ local function installPackage(pack,path,update)
|
|||||||
end
|
end
|
||||||
nPath = fs.concat(path,j,string.gsub(i,".+(/.-)$","%1"),nil)
|
nPath = fs.concat(path,j,string.gsub(i,".+(/.-)$","%1"),nil)
|
||||||
end
|
end
|
||||||
local success = pcall(downloadFile,"https://raw.githubusercontent.com/"..repo.."/"..i,nPath)
|
local success,response = pcall(downloadFile,"https://raw.githubusercontent.com/"..repo.."/"..i,nPath)
|
||||||
if success then
|
if success and response then
|
||||||
tPacks[pack][i] = nPath
|
tPacks[pack][i] = nPath
|
||||||
|
else
|
||||||
|
term.write("Error while installing files for package '"..pack.."'. Reverting installation... ")
|
||||||
|
fs.remove(nPath)
|
||||||
|
for o,p in pairs(tPacks[pack]) do
|
||||||
|
fs.remove(p)
|
||||||
|
tPacks[pack][o]=nil
|
||||||
|
end
|
||||||
|
print("Done.\nPlease contact the package author about this problem.")
|
||||||
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if info.dependencies then
|
if info.dependencies then
|
||||||
@ -386,9 +395,18 @@ local function installPackage(pack,path,update)
|
|||||||
nPath = fs.concat(path,j,string.gsub(i,".+(/.-)$","%1"),nil)
|
nPath = fs.concat(path,j,string.gsub(i,".+(/.-)$","%1"),nil)
|
||||||
end
|
end
|
||||||
if string.lower(string.sub(i,1,4))=="http" then
|
if string.lower(string.sub(i,1,4))=="http" then
|
||||||
local success = pcall(downloadFile,i,nPath)
|
local success,response = pcall(downloadFile,i,nPath)
|
||||||
if success then
|
if success and response then
|
||||||
tPacks[pack][i] = nPath
|
tPacks[pack][i] = nPath
|
||||||
|
else
|
||||||
|
term.write("Error while installing dependency package '"..i.."'. Reverting installation... ")
|
||||||
|
fs.remove(nPath)
|
||||||
|
for o,p in pairs(tPacks[pack]) do
|
||||||
|
fs.remove(p)
|
||||||
|
tPacks[pack][o]=nil
|
||||||
|
end
|
||||||
|
print("Done.\nPlease contact the package author about this problem.")
|
||||||
|
return
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
local depInfo = getInformation(string.lower(i))
|
local depInfo = getInformation(string.lower(i))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user