summaryrefslogtreecommitdiff
path: root/xmake/core/_xmake_main.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-08-25 09:19:35 +0800
committerruki <[email protected]>2019-08-25 09:19:35 +0800
commit6514385571fc00e18535a2f2e054177d91f867be (patch)
treeb97f5c11ccb573f2e968eadb3fdfbab4b7254ed8 /xmake/core/_xmake_main.lua
parent03bbbd76be1ef10d993ac472d1a01ce55b88bee4 (diff)
improve display pathes
Diffstat (limited to 'xmake/core/_xmake_main.lua')
-rw-r--r--xmake/core/_xmake_main.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/xmake/core/_xmake_main.lua b/xmake/core/_xmake_main.lua
index 631549cc0..ebba707eb 100644
--- a/xmake/core/_xmake_main.lua
+++ b/xmake/core/_xmake_main.lua
@@ -73,17 +73,20 @@ end
--
-- @param filepath the lua file path
-- @param mode the load mode, e.g 't', 'b' or 'bt' (default)
--- @param opt the arguments option, e.g. {displaypath = ""}
+-- @param opt the arguments option, e.g. {displaypath = "", nocache = true}
--
local _loadcache = {}
function loadfile(filepath, mode, opt)
+ -- init options
+ opt = opt or {}
+
-- get absolute path
filepath = path.absolute(filepath)
-- attempt to load script from cache first
local mtime = nil
- local cache = _loadcache[filepath]
+ local cache = (not opt.nocache) and _loadcache[filepath] or nil
if cache and cache.script then
mtime = os.mtime(filepath)
if mtime > 0 and cache.mtime == mtime then