From c464a7c482ced95d40452a3ca4eee66220567d44 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 3 Mar 2023 22:52:29 +0800 Subject: install to fish profile --- xmake/actions/update/main.lua | 1 + xmake/core/base/tty.lua | 7 +++++++ 2 files changed, 8 insertions(+) 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 -- cgit v1.3.1