summaryrefslogtreecommitdiff
path: root/xmake/core/base/xmake.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/core/base/xmake.lua')
-rw-r--r--xmake/core/base/xmake.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/xmake/core/base/xmake.lua b/xmake/core/base/xmake.lua
index 239540a5a..837742af2 100644
--- a/xmake/core/base/xmake.lua
+++ b/xmake/core/base/xmake.lua
@@ -29,7 +29,7 @@ function xmake.name()
return xmake._NAME or "xmake"
end
--- get xmake version
+-- get xmake version, e.g. v2.5.8+dev.d4cff6e11
function xmake.version()
if xmake._VERSION_CACHE == nil then
xmake._VERSION_CACHE = semver.new(xmake._VERSION) or false
@@ -37,6 +37,11 @@ function xmake.version()
return xmake._VERSION_CACHE or nil
end
+-- get the git branch of xmake version, e.g. build: {"dev", "d4cff6e11"}
+function xmake.branch()
+ return xmake.version():build()[1]
+end
+
-- get the program directory
function xmake.programdir()
return xmake._PROGRAM_DIR