summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2018-09-20 23:17:53 +0800
committerruki <[email protected]>2018-09-20 13:47:19 +0800
commit4067509774711e1f6c530c48f88de6159f4eb4e2 (patch)
tree2b7e359e40f237ff76a40da6e9d294b1b673e3da
parent5a757da5cdb45c5027a0090188c5b6401146fff4 (diff)
add XMAKE_ROOT env
-rw-r--r--xmake/core/main.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/xmake/core/main.lua b/xmake/core/main.lua
index 82a25840b..f724cfa2d 100644
--- a/xmake/core/main.lua
+++ b/xmake/core/main.lua
@@ -184,13 +184,13 @@ function main.done()
end
-- check run command as root
- if not option.get("root") then
+ if not option.get("root") and (not os.getenv("XMAKE_ROOT") or os.getenv("XMAKE_ROOT") ~= 'y') then
if os.isroot() then
if not privilege.store() or os.isroot() then
utils.error([[Running xmake as root is extremely dangerous and no longer supported.
As xmake does not drop privileges on installation you would be giving all
build scripts full access to your system.
-Or you can add `--root` option to allow run as root temporarily.
+Or you can add `--root` option or XMAKE_ROOT=y to allow run as root temporarily.
]])
return -1
end