diff options
Diffstat (limited to 'xmake/core')
| -rw-r--r-- | xmake/core/base/option.lua | 4 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/os.lua | 16 |
2 files changed, 19 insertions, 1 deletions
diff --git a/xmake/core/base/option.lua b/xmake/core/base/option.lua index eb9af790e..7deb2a3f4 100644 --- a/xmake/core/base/option.lua +++ b/xmake/core/base/option.lua @@ -724,13 +724,15 @@ function option.show_options(options) if name then if mode == "v" then option_info = option_info .. " " .. name + elseif mode == "vs" then + option_info = option_info .. " " .. name .. " ..." else option_info = option_info .. option._ifelse(shortname, ", --", " --") .. name end if mode == "kv" then option_info = option_info .. "=" .. name:upper() end - elseif mode == "v" then + elseif mode == "v" or mode == "vs" then option_info = option_info .. " ..." end diff --git a/xmake/core/sandbox/modules/os.lua b/xmake/core/sandbox/modules/os.lua index 923cc5852..9babc4318 100644 --- a/xmake/core/sandbox/modules/os.lua +++ b/xmake/core/sandbox/modules/os.lua @@ -24,6 +24,7 @@ local io = require("base/io") local os = require("base/os") local utils = require("base/utils") +local sandbox = require("sandbox/sandbox") local vformat = require("sandbox/modules/vformat") -- define module @@ -174,6 +175,21 @@ function sandbox_os.programdir() return xmake._PROGRAM_DIR end +-- get the script directory +function sandbox_os.scriptdir() + + -- get the current sandbox instance + local instance = sandbox.instance() + assert(instance) + + -- the root directory for this sandbox script + local rootdir = instance:rootdir() + assert(rootdir) + + -- ok + return rootdir +end + -- run shell function sandbox_os.run(cmd, ...) |
