diff options
| author | xq114 <[email protected]> | 2022-02-21 14:14:35 +0800 |
|---|---|---|
| committer | xq114 <[email protected]> | 2022-02-21 14:14:35 +0800 |
| commit | 2f76f4827888ec2ad996574d9370d40b37207dfb (patch) | |
| tree | f5f6117d14c7708eba46f900105d8540e7e73e35 | |
| parent | 422f43266ebf78f4cef79a8d82c5a36acf14daae (diff) | |
improve shell features
| -rw-r--r-- | xmake/actions/update/main.lua | 10 | ||||
| -rw-r--r-- | xmake/modules/private/xrepo/action/env.lua | 5 |
2 files changed, 9 insertions, 6 deletions
diff --git a/xmake/actions/update/main.lua b/xmake/actions/update/main.lua index 5ff75f69e..8df05c24b 100644 --- a/xmake/actions/update/main.lua +++ b/xmake/actions/update/main.lua @@ -150,16 +150,16 @@ function _uninstall() 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" }) + 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..d0418ee90 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 + utils.warning("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) |
