summaryrefslogtreecommitdiff
path: root/xmake/core/sandbox
diff options
context:
space:
mode:
authorruki <[email protected]>2016-05-31 20:18:34 +0800
committerruki <[email protected]>2016-05-31 20:18:34 +0800
commita976651039f008aa7e0e7ec6cfee57bfb2aea6fa (patch)
treeee79d06f607042c95c11e84bad519677be414ddb /xmake/core/sandbox
parent5769dba5932aad3a97c8db36c80a15064b71f556 (diff)
impl macro plugin
Diffstat (limited to 'xmake/core/sandbox')
-rw-r--r--xmake/core/sandbox/modules/import/core/project/history.lua7
-rw-r--r--xmake/core/sandbox/modules/os.lua15
2 files changed, 21 insertions, 1 deletions
diff --git a/xmake/core/sandbox/modules/import/core/project/history.lua b/xmake/core/sandbox/modules/import/core/project/history.lua
index fd10a22e7..ee1d6d9b4 100644
--- a/xmake/core/sandbox/modules/import/core/project/history.lua
+++ b/xmake/core/sandbox/modules/import/core/project/history.lua
@@ -39,5 +39,12 @@ function sandbox_core_project_history.load(key)
return history.load(key)
end
+-- save the history data
+function sandbox_core_project_history.save(key, value)
+
+ -- save it
+ history.save(key, value)
+end
+
-- return module
return sandbox_core_project_history
diff --git a/xmake/core/sandbox/modules/os.lua b/xmake/core/sandbox/modules/os.lua
index df2093f9f..923cc5852 100644
--- a/xmake/core/sandbox/modules/os.lua
+++ b/xmake/core/sandbox/modules/os.lua
@@ -216,7 +216,20 @@ function sandbox_os.corun(cmd, ...)
end
end
--- execute shell
+-- execute shell
+function sandbox_os.exec(cmd, ...)
+
+ -- make command
+ cmd = vformat(cmd, ...)
+
+ -- run it
+ local retval = os.execute(cmd)
+ if retval ~= 0 then
+ os.raise("exec %s failed(%d)!", cmd, retval)
+ end
+end
+
+-- execute shell and return error code
function sandbox_os.execute(cmd, ...)
-- make command