summaryrefslogtreecommitdiff
path: root/xmake/actions/update/main.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/actions/update/main.lua')
-rw-r--r--xmake/actions/update/main.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/xmake/actions/update/main.lua b/xmake/actions/update/main.lua
index 0590ab78f..afaed9e18 100644
--- a/xmake/actions/update/main.lua
+++ b/xmake/actions/update/main.lua
@@ -313,8 +313,13 @@ function _initialize_shell()
-- write home profile
local profile = "$XMAKE_PROGRAM_DIR/scripts/profile-unix.sh"
- local bridge_command = format("export XMAKE_ROOTDIR=\"%s\"\nexport XMAKE_PROGRAM_DIR=\"%s\"\nexport PATH=\"$XMAKE_ROOTDIR:$PATH\"\n", path.directory(os.programfile()), os.programdir())
- bridge_command = bridge_command .. format("test -f \"%s\" && source \"%s\"\n", profile, profile)
+ local profile_fish = "$XMAKE_PROGRAM_DIR/scripts/profile-unix.fish"
+ local bridge_command = format([[export XMAKE_ROOTDIR="%s"
+export XMAKE_PROGRAM_DIR="%s"
+export PATH="$XMAKE_ROOTDIR:$PATH"
+test $FISH_VERSION && test -f "%s" && source "%s" && exit 0
+test -f "%s" && source "%s"
+]], path.directory(os.programfile()), os.programdir(), profile_fish, profile_fish, profile, profile)
io.writefile("~/.xmake/profile", bridge_command)
end