summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2016-03-22 20:48:23 +0800
committerruki <[email protected]>2016-03-22 20:48:23 +0800
commit99b26ff26a985a65ca4a548d7ff2c87d8357ac39 (patch)
tree3ac8eb508e184c8c9f2482b321aaf8110244a7f3
parent54a4072a8c4fb163d58698ab4e575a5035a6233a (diff)
add rootdir argument for import
-rw-r--r--xmake/core/sandbox/modules/import.lua8
1 files 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