summaryrefslogtreecommitdiff
path: root/xmake/core/base/sandbox.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2016-03-01 23:41:55 +0800
committerruki <[email protected]>2016-03-01 23:41:55 +0800
commitef399ea6c252456e3f0ccb125412ced6d7735377 (patch)
tree5f6aa9aab1992ff323b60bfc31e16dfbcb245e3c /xmake/core/base/sandbox.lua
parent33cf83635ed21a2e39f09f2a28dceaf6f6abd5cd (diff)
import module name for task
Diffstat (limited to 'xmake/core/base/sandbox.lua')
-rw-r--r--xmake/core/base/sandbox.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/xmake/core/base/sandbox.lua b/xmake/core/base/sandbox.lua
index 252241e2f..3c4d1aceb 100644
--- a/xmake/core/base/sandbox.lua
+++ b/xmake/core/base/sandbox.lua
@@ -159,11 +159,16 @@ function sandbox.make(script, interp)
-- save root directory
self._PRIVATE._ROOTDIR = interp:rootdir()
- -- this script is file? load it first
+ -- this script is module name? import it first
if type(script) == "string" then
- -- TODO
- assert(false)
+ -- import module as script
+ local modulename = script
+ script = function ()
+
+ -- import it
+ import(modulename).main()
+ end
end
-- no script?