diff options
| author | ruki <[email protected]> | 2023-03-03 23:14:34 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-03-03 23:14:34 +0800 |
| commit | 03e6e829efe43c2e78673ef2b2da86bbd7f797b4 (patch) | |
| tree | e23aec3dec2c82e816eb484c81edd6e9b3acd475 | |
| parent | 751fdb04c1e7bc1e4ef43bca5d05ee3f53f02250 (diff) | |
improve path
| -rw-r--r-- | xmake/actions/update/main.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xmake/actions/update/main.lua b/xmake/actions/update/main.lua index adf5f6819..938ca8cf4 100644 --- a/xmake/actions/update/main.lua +++ b/xmake/actions/update/main.lua @@ -291,7 +291,7 @@ end -- initialize shells function _initialize_shell() - local target, command + local target, command, profile_home if is_host("windows") then local psshell = find_tool("pwsh") or find_tool("powershell") local outdata, errdata = try {function () return os.iorunv(psshell.program, {"-c", "Write-Output $PROFILE.CurrentUserAllHosts"}) end} @@ -310,7 +310,7 @@ function _initialize_shell() elseif shell:endswith("ksh") then target = "~/.kshrc" elseif shell:endswith("fish") then target = "~/.config/fish/config.fish" end - local profile_home = path.absolute("~/.xmake/profile") + profile_home = path.absolute("~/.xmake/profile") command = ("test -f \"%s\" && source \"%s\""):format(profile_home, profile_home) -- write home profile @@ -353,9 +353,9 @@ test -f "%s" && source "%s" -- trace if ok then cprint("${color.success}${text.success}") - if not is_host("windows") then + if not is_host("windows") and profile_home then print("Reload shell profile by running the following command now!") - cprint("${bright}source ~/.xmake/profile${clear}") + cprint("${bright}source %s${clear}", profile_home) end else cprint("${color.failure}${text.failure}") |
