diff options
| author | TitanSnow <[email protected]> | 2017-05-25 09:33:01 +0800 |
|---|---|---|
| committer | TitanSnow <[email protected]> | 2017-05-25 09:33:01 +0800 |
| commit | c55e08adb365c2b56f75200a361c76fa50434963 (patch) | |
| tree | 6b70d4b24a95b46380037950f691ecb8839fa887 /xmake/modules/privilege/sudo.lua | |
| parent | 1f937057f3f7c29bbb074dec7047e55a44131f51 (diff) | |
| parent | 1c48d7c8a0d5646c8452fb3ee1f08eb68fe7311d (diff) | |
Merge branch 'dev' into installtest
Diffstat (limited to 'xmake/modules/privilege/sudo.lua')
| -rw-r--r-- | xmake/modules/privilege/sudo.lua | 12 |
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 |
