summaryrefslogtreecommitdiff
path: root/xmake/actions/install/install_admin.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2024-07-16 22:46:29 +0800
committerruki <[email protected]>2024-07-16 22:46:29 +0800
commit47b8220c696df2fe33e8e24590d871feedfabf2a (patch)
treee239c3f6afc2c9c5ccc3a93a985a42f851da83bc /xmake/actions/install/install_admin.lua
parent79fffb69b3bff30eacc42e0547c53041b207c75d (diff)
fix install/uninstall with admin
Diffstat (limited to 'xmake/actions/install/install_admin.lua')
-rw-r--r--xmake/actions/install/install_admin.lua21
1 files changed, 6 insertions, 15 deletions
diff --git a/xmake/actions/install/install_admin.lua b/xmake/actions/install/install_admin.lua
index ba5101324..93fbf5beb 100644
--- a/xmake/actions/install/install_admin.lua
+++ b/xmake/actions/install/install_admin.lua
@@ -25,39 +25,30 @@ import("core.project.project")
import("core.platform.platform")
import("install")
--- install
function main(targetname, group_pattern, installdir, prefix)
-
local verbose = option.get("verbose")
+ if group_pattern and #group_pattern == 0 then
+ group_pattern = nil
+ end
+ if installdir and #installdir == 0 then
+ installdir = nil
+ end
- -- enter project directory
os.cd(project.directory())
-
- -- load config
config.load()
-
- -- load platform
platform.load(config.plat())
-- 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)
end
-
- -- pass prefix to option
if prefix then
option.set("prefix", prefix)
end
-- install target
install(targetname, group_pattern)
-
- -- restore the previous option context
option.restore()
end