mirror of
https://github.com/zenith391/OCEmu.git
synced 2025-09-30 00:28:05 -04:00
Cleanup boot.lua
This commit is contained in:
parent
e33eab3e9f
commit
6ac67312ae
11
src/boot.lua
11
src/boot.lua
@ -49,8 +49,6 @@ local function boot()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local os_remove_leaf = os.remove
|
|
||||||
|
|
||||||
local recursiveDelete
|
local recursiveDelete
|
||||||
function recursiveDelete(path)
|
function recursiveDelete(path)
|
||||||
local mode = lfs.attributes(path,"mode")
|
local mode = lfs.attributes(path,"mode")
|
||||||
@ -64,11 +62,11 @@ local function boot()
|
|||||||
if mode == "directory" then
|
if mode == "directory" then
|
||||||
recursiveDelete(path .. "/" .. entry)
|
recursiveDelete(path .. "/" .. entry)
|
||||||
end
|
end
|
||||||
os_remove_leaf(path .. "/" .. entry)
|
os.remove(path .. "/" .. entry)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return os_remove_leaf(path)
|
return os.remove(path)
|
||||||
end
|
end
|
||||||
|
|
||||||
elsa = {
|
elsa = {
|
||||||
@ -133,9 +131,9 @@ local function boot()
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- redirect os.remove is non posix
|
-- redirect os.remove is non posix
|
||||||
if os.getenv('os') == 'Windows_NT' then
|
if ffi.os == 'Windows' then
|
||||||
local os_remove = os.remove
|
local os_remove = os.remove
|
||||||
os_remove_leaf = function(path)
|
os.remove = function(path)
|
||||||
local mode = lfs.attributes(path,"mode")
|
local mode = lfs.attributes(path,"mode")
|
||||||
if mode == nil then
|
if mode == nil then
|
||||||
return false
|
return false
|
||||||
@ -145,7 +143,6 @@ local function boot()
|
|||||||
return os_remove(path)
|
return os_remove(path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
os.remove = elsa.remove
|
|
||||||
end
|
end
|
||||||
|
|
||||||
require("main")
|
require("main")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user