diff options
| author | ruki <[email protected]> | 2021-08-20 06:50:40 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-08-20 06:50:40 +0800 |
| commit | 4f0662ed2bfae508b6083b3b5881be32940daf6f (patch) | |
| tree | dc13121155a20df100e1cfca2ca74e509a286339 | |
| parent | 9c096fc45a4fb8ac817eb48ab8e762e2b41ab259 (diff) | |
| parent | 63e0022eaa60b02f5215a8792a54a6cdddc61619 (diff) | |
Merge pull request #1588 from SirLynix/fix-install-output
Fix install/uninstall output when using --admin
| -rw-r--r-- | xmake/actions/install/install_admin.lua | 5 | ||||
| -rw-r--r-- | xmake/actions/install/main.lua | 2 | ||||
| -rw-r--r-- | xmake/actions/uninstall/main.lua | 2 | ||||
| -rw-r--r-- | xmake/actions/uninstall/uninstall_admin.lua | 5 |
4 files changed, 12 insertions, 2 deletions
diff --git a/xmake/actions/install/install_admin.lua b/xmake/actions/install/install_admin.lua index 1f0103d27..c2b57f05d 100644 --- a/xmake/actions/install/install_admin.lua +++ b/xmake/actions/install/install_admin.lua @@ -28,6 +28,8 @@ import("install") -- install function main(targetname, installdir, prefix) + local verbose = option.get("verbose") + -- enter project directory os.cd(project.directory()) @@ -40,6 +42,9 @@ function main(targetname, installdir, prefix) -- save the current option and push a new option context option.save() + -- preserve verbose option + option.set("verbose", verbose) + -- pass installdir to option if installdir then option.set("installdir", installdir) diff --git a/xmake/actions/install/main.lua b/xmake/actions/install/main.lua index 40ba15cc3..febae713b 100644 --- a/xmake/actions/install/main.lua +++ b/xmake/actions/install/main.lua @@ -110,7 +110,7 @@ function main() if sudo.has() and option.get("admin") then -- install target with administrator permission - sudo.runl(path.join(os.scriptdir(), "install_admin.lua"), {targetname or (option.get("all") and "__all" or "__def"), option.get("installdir"), option.get("prefix")}) + sudo.execl(path.join(os.scriptdir(), "install_admin.lua"), {targetname or (option.get("all") and "__all" or "__def"), option.get("installdir"), option.get("prefix")}) cprint("${color.success}install ok!") ok = true end diff --git a/xmake/actions/uninstall/main.lua b/xmake/actions/uninstall/main.lua index eedde054e..3e6769c24 100644 --- a/xmake/actions/uninstall/main.lua +++ b/xmake/actions/uninstall/main.lua @@ -81,7 +81,7 @@ function main() if sudo.has() and option.get("admin") then -- uninstall target with administrator permission - sudo.runl(path.join(os.scriptdir(), "uninstall_admin.lua"), {targetname or "__all", option.get("installdir"), option.get("prefix")}) + sudo.execl(path.join(os.scriptdir(), "uninstall_admin.lua"), {targetname or "__all", option.get("installdir"), option.get("prefix")}) -- trace cprint("${color.success}uninstall ok!") diff --git a/xmake/actions/uninstall/uninstall_admin.lua b/xmake/actions/uninstall/uninstall_admin.lua index c30a16a01..f597dea11 100644 --- a/xmake/actions/uninstall/uninstall_admin.lua +++ b/xmake/actions/uninstall/uninstall_admin.lua @@ -28,6 +28,8 @@ import("uninstall") -- uninstall function main(targetname, installdir, prefix) + local verbose = option.get("verbose") + -- enter project directory os.cd(project.directory()) @@ -40,6 +42,9 @@ function main(targetname, installdir, prefix) -- save the current option and push a new option context option.save() + -- preserve verbose option + option.set("verbose", verbose) + -- pass installdir to option if installdir then option.set("installdir", installdir) |
