diff options
| author | ruki <[email protected]> | 2023-03-03 22:52:29 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-03-03 22:52:29 +0800 |
| commit | c464a7c482ced95d40452a3ca4eee66220567d44 (patch) | |
| tree | d74c1d3c54650e9a01fd397e307574c6758b9895 | |
| parent | 317910e7d4c19fc5aa461edea90cda0f2b16bc25 (diff) | |
install to fish profile
| -rw-r--r-- | xmake/actions/update/main.lua | 1 | ||||
| -rw-r--r-- | xmake/core/base/tty.lua | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/xmake/actions/update/main.lua b/xmake/actions/update/main.lua index afaed9e18..4433d18d8 100644 --- a/xmake/actions/update/main.lua +++ b/xmake/actions/update/main.lua @@ -308,6 +308,7 @@ function _initialize_shell() if shell:endswith("bash") then target = (is_host("macosx") and "~/.bash_profile" or "~/.bashrc") elseif shell:endswith("zsh") then target = "~/.zshrc" elseif shell:endswith("ksh") then target = "~/.kshrc" + elseif shell:endswith("fish") then target = "~/.config/fish/config.fish" end command = "test -f \"$HOME/.xmake/profile\" && source \"$HOME/.xmake/profile\"" diff --git a/xmake/core/base/tty.lua b/xmake/core/base/tty.lua index 8fa00d494..f6fa0b622 100644 --- a/xmake/core/base/tty.lua +++ b/xmake/core/base/tty.lua @@ -175,6 +175,13 @@ function tty.shell() end end end + if not shell then + if os.getenv("BASH_VERSION") then + shell = "bash" + elseif os.getenv("FISH_VERSION") then + shell = "fish" + end + end end tty._SHELL = shell or "sh" end |
