diff options
| author | ruki <[email protected]> | 2017-03-27 14:52:33 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-03-27 14:52:33 +0800 |
| commit | 3bbd679fd2edbda30369d74a02949fd193a93211 (patch) | |
| tree | 4ff12a24fe935be93c41525729f7f7ee47d09ed5 /xmake/core | |
| parent | cbe9a6b04ec8fca881fc39d360e941bf795c86da (diff) | |
wrap sudo
Diffstat (limited to 'xmake/core')
| -rw-r--r-- | xmake/core/base/os.lua | 12 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/os.lua | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index cfbc00611..39be26ade 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -590,5 +590,17 @@ function os.isexec(filepath) return os.isfile(filepath) end +-- get sudo program name for running program with administrator permission +function os.sudo() + + -- on windows? + if xmake._HOST == "windows" then + -- TODO + -- add sudo.bat + else + return "sudo" + end +end + -- return module return os diff --git a/xmake/core/sandbox/modules/os.lua b/xmake/core/sandbox/modules/os.lua index 29cf115f4..15f75ae08 100644 --- a/xmake/core/sandbox/modules/os.lua +++ b/xmake/core/sandbox/modules/os.lua @@ -445,6 +445,11 @@ function sandbox_os.uuid(name) return uuid end +-- get sudo program name for running program with administrator permission +function sandbox_os.sudo() + return os.sudo() +end + -- return module return sandbox_os |
