From 99b26ff26a985a65ca4a548d7ff2c87d8357ac39 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 22 Mar 2016 20:48:23 +0800 Subject: add rootdir argument for import --- xmake/core/sandbox/modules/import.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xmake/core/sandbox/modules/import.lua b/xmake/core/sandbox/modules/import.lua index 0577097ed..78a7cabee 100644 --- a/xmake/core/sandbox/modules/import.lua +++ b/xmake/core/sandbox/modules/import.lua @@ -227,8 +227,12 @@ end -- import("core") -- => core -- => core.platform +--- +-- import("core", nil, "/scripts") +-- => core +-- => core.platform -- -function sandbox_import.import(name, alias) +function sandbox_import.import(name, alias, rootdir) -- check assert(name) @@ -238,7 +242,7 @@ function sandbox_import.import(name, alias) assert(instance) -- the root directory for this sandbox script - local rootdir = instance:rootdir() + local rootdir = rootdir or instance:rootdir() assert(rootdir) -- load module -- cgit v1.3.1