summaryrefslogtreecommitdiff
path: root/xmake/modules/privilege/sudo.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/modules/privilege/sudo.lua')
-rw-r--r--xmake/modules/privilege/sudo.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/xmake/modules/privilege/sudo.lua b/xmake/modules/privilege/sudo.lua
index 099939fc9..d2e2de2cf 100644
--- a/xmake/modules/privilege/sudo.lua
+++ b/xmake/modules/privilege/sudo.lua
@@ -37,9 +37,9 @@ function _sudo(runner, cmd, ...)
local program = find_sudo()
assert(program, "sudo not found!")
- -- FIXME: deal with spaces in `os.getenv("PATH")`
+ -- FIXME: deal with quotes in `os.getenv("PATH")`
-- run it with administrator permission and preserve parent environment
- runner(program .. " env PATH=" .. os.getenv("PATH") .. " " .. cmd, ...)
+ runner(program .. " env PATH=\"" .. os.getenv("PATH") .. "\" " .. cmd, ...)
end
-- sudo run shell with administrator permission and arguments list
@@ -91,7 +91,7 @@ end
-- sudo run shell with arguments list
function runv(shellname, argv)
- return _sudo(os.run, shellname, argv)
+ return _sudov(os.run, shellname, argv)
end
-- sudo quietly run shell and echo verbose info if [-v|--verbose] option is enabled
@@ -101,7 +101,7 @@ end
-- sudo quietly run shell with arguments list and echo verbose info if [-v|--verbose] option is enabled
function vrunv(shellname, argv)
- return _sudo(os.vrunv, shellname, argv)
+ return _sudov(os.vrunv, shellname, argv)
end
-- sudo run shell and return output and error data
@@ -111,7 +111,7 @@ end
-- sudo run shell and return output and error data
function iorunv(shellname, argv)
- return _sudo(os.iorunv, shellname, argv)
+ return _sudov(os.iorunv, shellname, argv)
end
-- sudo execute shell
@@ -121,7 +121,7 @@ end
-- sudo execute shell with arguments list
function execv(shellname, argv)
- return _sudo(os.execv, shellname, argv)
+ return _sudov(os.execv, shellname, argv)
end
-- sudo run lua script