Cleanup boot.lua

This commit is contained in:
gamax92 2015-08-25 23:54:08 -06:00
parent e33eab3e9f
commit 6ac67312ae

View File

@ -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")