summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-03-03 23:13:28 +0800
committerruki <[email protected]>2023-03-03 23:13:28 +0800
commit751fdb04c1e7bc1e4ef43bca5d05ee3f53f02250 (patch)
tree61ada54d73e7f6894f555c2335a1acc43676f507
parente142ac03925e8f04a8d58084ba00ca1edd0379e9 (diff)
fix profile
-rw-r--r--xmake/actions/update/main.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/xmake/actions/update/main.lua b/xmake/actions/update/main.lua
index dc8b3bcf0..adf5f6819 100644
--- a/xmake/actions/update/main.lua
+++ b/xmake/actions/update/main.lua
@@ -310,7 +310,8 @@ function _initialize_shell()
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\""
+ local profile_home = path.absolute("~/.xmake/profile")
+ command = ("test -f \"%s\" && source \"%s\""):format(profile_home, profile_home)
-- write home profile
local profile = "$XMAKE_PROGRAM_DIR/scripts/profile-unix.sh"
@@ -321,7 +322,7 @@ 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)
+ io.writefile(profile_home, bridge_command)
end
-- trace