summaryrefslogtreecommitdiff
path: root/xmake/scripts
diff options
context:
space:
mode:
authorwanzzhehe <[email protected]>2024-05-15 15:13:50 +0800
committerwanzzhehe <[email protected]>2024-05-15 15:13:50 +0800
commitc98080e93f0005d3d4f00a22df8633afe2051c85 (patch)
treef26233b76d5a9a6e9f43e6a65b19e00ae45bc4a9 /xmake/scripts
parent304943e79b6e2c67d2c010f053d8cd2a42460ddd (diff)
Fix repeat add XMAKE_ROOTDIR to PATH in Linux
Diffstat (limited to 'xmake/scripts')
-rw-r--r--xmake/scripts/profile-unix.fish4
-rw-r--r--xmake/scripts/profile-unix.sh3
2 files changed, 7 insertions, 0 deletions
diff --git a/xmake/scripts/profile-unix.fish b/xmake/scripts/profile-unix.fish
index ea0f243de..4811a5f12 100644
--- a/xmake/scripts/profile-unix.fish
+++ b/xmake/scripts/profile-unix.fish
@@ -18,6 +18,10 @@
# @homepage profile-unix.fish
#
+# register PATH
+string match --regex --quiet "(^|:)$XMAKE_ROOTDIR(:|\$)" "$PATH" && \
+ export PATH="$XMAKE_ROOTDIR:$PATH"
+
# register environments
export XMAKE_SHELL=fish
diff --git a/xmake/scripts/profile-unix.sh b/xmake/scripts/profile-unix.sh
index 1695b2331..93dd7157c 100644
--- a/xmake/scripts/profile-unix.sh
+++ b/xmake/scripts/profile-unix.sh
@@ -18,6 +18,9 @@
# @homepage profile-unix.sh
#
+# register PATH
+[[ "$PATH" =~ (^|:)"$XMAKE_ROOTDIR"(:|$) ]] && export PATH="$XMAKE_ROOTDIR:$PATH"
+
# register completions
if [[ -n "$ZSH_VERSION" ]]; then
export XMAKE_SHELL=zsh