summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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