summaryrefslogtreecommitdiff
path: root/xmake/core/base/xmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-10-29 00:45:53 +0800
committerruki <[email protected]>2021-10-29 00:45:53 +0800
commit9eedba8ac9cd4832e20343a0eda720b9c1ceb5a9 (patch)
treece172eaa9a79a168c4f35468dea3bf6231f2e700 /xmake/core/base/xmake.lua
parentb8baa986376112e67221fa8b982d2b3197e1d919 (diff)
add xmake.branch
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