summaryrefslogtreecommitdiff
path: root/xmake/actions/install/main.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-05-24 11:45:37 +0800
committerruki <[email protected]>2017-05-24 11:45:37 +0800
commit4e52205dc696ade5ba01c8d6ccf9831b59ad6196 (patch)
tree2a2e2065ed0f65b019168d2e3f099363d4b96a26 /xmake/actions/install/main.lua
parent0041140dbfebce83293bcd3991760c8651f7a7ee (diff)
add privilege.sudo and find sudo modules
Diffstat (limited to 'xmake/actions/install/main.lua')
-rw-r--r--xmake/actions/install/main.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/xmake/actions/install/main.lua b/xmake/actions/install/main.lua
index ae98f3eea..976478a76 100644
--- a/xmake/actions/install/main.lua
+++ b/xmake/actions/install/main.lua
@@ -27,6 +27,7 @@ import("core.base.option")
import("core.project.task")
import("core.platform.platform")
import("core.base.privilege")
+import("privilege.sudo")
import("install")
-- main
@@ -47,7 +48,7 @@ function main()
function ()
-- install target
- install.install(targetname or ifelse(option.get("all"), "__all", "__def"))
+ install(targetname or ifelse(option.get("all"), "__all", "__def"))
-- trace
cprint("${bright}install ok!${clear}${ok_hand}")
@@ -65,7 +66,7 @@ function main()
function ()
-- install target
- install.install(targetname or ifelse(option.get("all"), "__all", "__def"))
+ install(targetname or ifelse(option.get("all"), "__all", "__def"))
-- trace
cprint("${bright}install ok!${clear}${ok_hand}")
@@ -86,7 +87,7 @@ function main()
cprint("${bright red}error: ${default red}installation failed, may permission denied!")
-- continue to install with administrator permission?
- if os.feature("sudo") then
+ if sudo.has() then
-- show tips
cprint("${bright yellow}note: ${default yellow}try continue to install with administrator permission again?")
@@ -98,7 +99,7 @@ function main()
if answer == 'y' or answer == '' then
-- install target with administrator permission
- os.sudol(os.runv, path.join(os.scriptdir(), "install_admin.lua"), {targetname or ifelse(option.get("all"), "__all", "__def"), option.get("installdir")})
+ sudo.runl(path.join(os.scriptdir(), "install_admin.lua"), {targetname or ifelse(option.get("all"), "__all", "__def"), option.get("installdir")})
-- trace
cprint("${bright}install ok!${clear}${ok_hand}")