diff options
| author | ruki <[email protected]> | 2022-02-21 18:11:25 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-02-21 18:11:25 +0800 |
| commit | 25b856d49bd8c0531fe3a065f54922142390da8e (patch) | |
| tree | fd58646387413437ce8f1a75c351cbaebb2acdd0 | |
| parent | 422f43266ebf78f4cef79a8d82c5a36acf14daae (diff) | |
| parent | 7b1eaeda786524fa2ffcb84b4879904867a55e7a (diff) | |
Merge pull request #2074 from xq114/dev
improve shell features
| -rw-r--r-- | xmake/actions/update/main.lua | 12 | ||||
| -rw-r--r-- | xmake/modules/private/xrepo/action/env.lua | 5 |
2 files changed, 10 insertions, 7 deletions
diff --git a/xmake/actions/update/main.lua b/xmake/actions/update/main.lua index 5ff75f69e..b96dfe02b 100644 --- a/xmake/actions/update/main.lua +++ b/xmake/actions/update/main.lua @@ -149,17 +149,17 @@ function _uninstall() end else if os.programdir():startswith("/usr/") then - _sudo_v("xmake", {"lua", "rm", os.programdir() }) - if os.isfile("/usr/local/bin/xmake") then - _sudo_v("xmake", {"lua", "rm", "/usr/local/bin/xmake" }) - end - if os.isfile("/usr/bin/xmake") then - _sudo_v("xmake", {"lua", "rm", "/usr/bin/xmake" }) + _sudo_v("xmake", {"lua", "rm", os.programdir()}) + for _, f in ipairs({"/usr/local/bin/xmake", "/usr/local/bin/xrepo", "/usr/bin/xmake", "/usr/bin/xrepo"}) do + if os.isfile(f) then + _sudo_v("xmake", {"lua", "rm", f}) + end end else os.rm(os.programdir()) os.rm(os.programfile()) os.rm("~/.local/bin/xmake") + os.rm("~/.local/bin/xrepo") end end end diff --git a/xmake/modules/private/xrepo/action/env.lua b/xmake/modules/private/xrepo/action/env.lua index a61a184b8..2ab817587 100644 --- a/xmake/modules/private/xrepo/action/env.lua +++ b/xmake/modules/private/xrepo/action/env.lua @@ -470,8 +470,11 @@ function main() local envname = assert(option.get("program"), "please set environment config name!") os.rm(path.join(_get_envsdir(), envname .. ".lua")) else - local envs = _package_getenvs() local program = option.get("program") + if program and program == "shell" then + wprint("The shell was not integrated with xmake. Some features might be missing. Please switch to your default shell, and run `xmake update --integrate` to integrate the shell.") + end + local envs = _package_getenvs() if program and not option.get("show") then if envs and envs.PATH then os.setenv("PATH", envs.PATH) |
