diff options
| author | ruki <[email protected]> | 2022-04-14 00:23:35 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-04-14 00:23:35 +0800 |
| commit | b3d43d26103d29ce04878b74ff101d8fcb321164 (patch) | |
| tree | d541925ac51319774cf69742bf705daed131d1d1 | |
| parent | 8e4983bd55693419b6a7e6548e74e8c829acf5f3 (diff) | |
improve run and install
| -rw-r--r-- | xmake/actions/install/main.lua | 13 | ||||
| -rw-r--r-- | xmake/actions/run/main.lua | 8 | ||||
| -rw-r--r-- | xmake/actions/uninstall/main.lua | 8 |
3 files changed, 9 insertions, 20 deletions
diff --git a/xmake/actions/install/main.lua b/xmake/actions/install/main.lua index 82534ffe0..614678cf7 100644 --- a/xmake/actions/install/main.lua +++ b/xmake/actions/install/main.lua @@ -21,6 +21,7 @@ -- imports import("core.base.option") import("core.base.task") +import("core.project.config") import("core.project.project") import("core.platform.platform") import("core.base.privilege") @@ -63,24 +64,18 @@ end -- main function main() - -- get the target name - local targetname = option.get("target") - - -- config it first - task.run("config", {target = targetname, require = "n", verbose = false}) + -- local config first + config.load() -- check targets first + local targetname = option.get("target") _check_targets(targetname) -- attempt to install directly try { function () - - -- install target install(targetname or (option.get("all") and "__all" or "__def")) - - -- trace cprint("${color.success}install ok!") end, diff --git a/xmake/actions/run/main.lua b/xmake/actions/run/main.lua index 72983c446..8a6129ba7 100644 --- a/xmake/actions/run/main.lua +++ b/xmake/actions/run/main.lua @@ -181,7 +181,10 @@ end -- main function main() - -- config it first + -- load config first + config.load() + + -- check targets first local targetname local group_pattern = option.get("group") if group_pattern then @@ -189,9 +192,6 @@ function main() else targetname = option.get("target") end - task.run("config", {target = targetname, require = "n", verbose = false}) - - -- check targets first _check_targets(targetname, group_pattern) -- enter project directory diff --git a/xmake/actions/uninstall/main.lua b/xmake/actions/uninstall/main.lua index 3e6769c24..4ba78cd7f 100644 --- a/xmake/actions/uninstall/main.lua +++ b/xmake/actions/uninstall/main.lua @@ -29,21 +29,15 @@ import("uninstall") -- main function main() - -- get the target name - local targetname = option.get("target") - -- config it first + local targetname = option.get("target") task.run("config", {target = targetname, require = "n", verbose = false}) -- attempt to uninstall directly try { function () - - -- uninstall target uninstall(targetname) - - -- trace cprint("${color.success}uninstall ok!") end, |
