From c98080e93f0005d3d4f00a22df8633afe2051c85 Mon Sep 17 00:00:00 2001 From: wanzzhehe Date: Wed, 15 May 2024 15:13:50 +0800 Subject: Fix repeat add XMAKE_ROOTDIR to PATH in Linux --- xmake/scripts/profile-unix.fish | 4 ++++ xmake/scripts/profile-unix.sh | 3 +++ 2 files changed, 7 insertions(+) (limited to 'xmake/scripts') 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 -- cgit v1.3.1