diff options
| author | ruki <[email protected]> | 2023-03-03 22:50:30 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-03-03 22:50:30 +0800 |
| commit | 317910e7d4c19fc5aa461edea90cda0f2b16bc25 (patch) | |
| tree | c4f912b64c4811ba08d85c60e58df63a23fe3b71 /xmake/actions/update/main.lua | |
| parent | 409fe90b6fa9a58e7bc34471ecbab945399235e7 (diff) | |
improve fish profile
Diffstat (limited to 'xmake/actions/update/main.lua')
| -rw-r--r-- | xmake/actions/update/main.lua | 9 |
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 |
