summaryrefslogtreecommitdiff
path: root/xmake/core
diff options
context:
space:
mode:
authorTitanSnow <[email protected]>2017-05-22 15:22:16 +0800
committerTitanSnow <[email protected]>2017-05-22 18:37:43 +0800
commitd4aab4ff42e4032f848e0c6f048aaa61cb7db18b (patch)
tree260e81f2772901d2704b08a57286233204857ab8 /xmake/core
parent2ca174000e9be4878321c08920e7abfc76b89d88 (diff)
add os.gid()
Diffstat (limited to 'xmake/core')
-rw-r--r--xmake/core/base/os.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua
index 0bae655b7..a56c199dd 100644
--- a/xmake/core/base/os.lua
+++ b/xmake/core/base/os.lua
@@ -34,6 +34,7 @@ local string = require("base/string")
-- save original interfaces
os._uid = os._uid or os.uid
+os._gid = os._gid or os.gid
os._mkdir = os._mkdir or os.mkdir
os._rmdir = os._rmdir or os.rmdir
os._tmpdir = os._tmpdir or os.tmpdir
@@ -638,6 +639,18 @@ function os.uid(...)
return os._UID
end
+-- get gid
+function os.gid(...)
+ -- get gid
+ os._GID = {}
+ if os._gid then
+ os._GID = os._gid(...) or {}
+ end
+
+ -- ok?
+ return os._GID
+end
+
-- check run command as root
function os.isroot()