make dir if does not exist
This commit is contained in:
parent
8c2d3acdec
commit
1d58f51ba4
2 changed files with 25 additions and 13 deletions
|
@ -85,12 +85,18 @@ local function finishInstall(files)
|
||||||
for key, file in ipairs(files) do
|
for key, file in ipairs(files) do
|
||||||
if customPath ~= nil then
|
if customPath ~= nil then
|
||||||
print("moving " .. file .. " to " .. customPath .. "...")
|
print("moving " .. file .. " to " .. customPath .. "...")
|
||||||
|
if not fs.exists(customPath) then
|
||||||
|
fs.makeDir(customPath)
|
||||||
|
end
|
||||||
if fs.exists(customPath .. "/" .. file) then
|
if fs.exists(customPath .. "/" .. file) then
|
||||||
fs.delete(customPath .. "/" .. file)
|
fs.delete(customPath .. "/" .. file)
|
||||||
end
|
end
|
||||||
fs.move(temp .. file, customPath .. "/" .. file)
|
fs.move(temp .. file, customPath .. "/" .. file)
|
||||||
else
|
else
|
||||||
print("moving " .. file .. " to " .. path .. programToInstall .. "...")
|
print("moving " .. file .. " to " .. path .. programToInstall .. "...")
|
||||||
|
if not fs.exists(path .. programToInstall) then
|
||||||
|
fs.makeDir(path .. programToInstall)
|
||||||
|
end
|
||||||
if fs.exists(path .. programToInstall .. "/" .. file) then
|
if fs.exists(path .. programToInstall .. "/" .. file) then
|
||||||
fs.delete(path .. programToInstall .. "/" .. file)
|
fs.delete(path .. programToInstall .. "/" .. file)
|
||||||
end
|
end
|
||||||
|
|
|
@ -102,12 +102,18 @@ local function finishInstall(files)
|
||||||
for key, file in ipairs(files) do
|
for key, file in ipairs(files) do
|
||||||
if customPath ~= nil then
|
if customPath ~= nil then
|
||||||
print("moving " .. file .. " to " .. customPath .. "...")
|
print("moving " .. file .. " to " .. customPath .. "...")
|
||||||
|
if not fs.exists(customPath) then
|
||||||
|
fs.makeDir(customPath)
|
||||||
|
end
|
||||||
if fs.exists(customPath .. "/" .. file) then
|
if fs.exists(customPath .. "/" .. file) then
|
||||||
fs.delete(customPath .. "/" .. file)
|
fs.delete(customPath .. "/" .. file)
|
||||||
end
|
end
|
||||||
fs.move(temp .. file, customPath .. "/" .. file)
|
fs.move(temp .. file, customPath .. "/" .. file)
|
||||||
else
|
else
|
||||||
print("moving " .. file .. " to " .. path .. programToInstall .. "...")
|
print("moving " .. file .. " to " .. path .. programToInstall .. "...")
|
||||||
|
if not fs.exists(path .. programToInstall) then
|
||||||
|
fs.makeDir(path .. programToInstall)
|
||||||
|
end
|
||||||
if fs.exists(path .. programToInstall .. "/" .. file) then
|
if fs.exists(path .. programToInstall .. "/" .. file) then
|
||||||
fs.delete(path .. programToInstall .. "/" .. file)
|
fs.delete(path .. programToInstall .. "/" .. file)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue