From b3f9bd3dc137f44d84aafc7c28d8495ede9be580 Mon Sep 17 00:00:00 2001 From: wanzzhehe Date: Thu, 16 May 2024 17:38:47 +0800 Subject: Fix bug: can't add XMAKE_ROOTDIR to PATH --- scripts/get.sh | 2 +- xmake/scripts/profile-unix.fish | 2 +- xmake/scripts/profile-unix.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/get.sh b/scripts/get.sh index f88e9ce7b..4b9c80156 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -237,7 +237,7 @@ fi # install_profile() { export XMAKE_ROOTDIR="$prefix/bin" - [[ "$PATH" =~ (^|:)"$XMAKE_ROOTDIR"(:|$) ]] && export PATH="$XMAKE_ROOTDIR:$PATH" + [[ "$PATH" =~ (^|:)"$XMAKE_ROOTDIR"(:|$) ]] || export PATH="$XMAKE_ROOTDIR:$PATH" xmake --version xmake update --integrate } diff --git a/xmake/scripts/profile-unix.fish b/xmake/scripts/profile-unix.fish index 4811a5f12..e89b1f5cc 100644 --- a/xmake/scripts/profile-unix.fish +++ b/xmake/scripts/profile-unix.fish @@ -19,7 +19,7 @@ # # register PATH -string match --regex --quiet "(^|:)$XMAKE_ROOTDIR(:|\$)" "$PATH" && \ +string match --regex --quiet "(^|:)$XMAKE_ROOTDIR(:|\$)" "$PATH" || \ export PATH="$XMAKE_ROOTDIR:$PATH" # register environments diff --git a/xmake/scripts/profile-unix.sh b/xmake/scripts/profile-unix.sh index 93dd7157c..1f5b69d0c 100644 --- a/xmake/scripts/profile-unix.sh +++ b/xmake/scripts/profile-unix.sh @@ -19,7 +19,7 @@ # # register PATH -[[ "$PATH" =~ (^|:)"$XMAKE_ROOTDIR"(:|$) ]] && export PATH="$XMAKE_ROOTDIR:$PATH" +[[ "$PATH" =~ (^|:)"$XMAKE_ROOTDIR"(:|$) ]] || export PATH="$XMAKE_ROOTDIR:$PATH" # register completions if [[ -n "$ZSH_VERSION" ]]; then -- cgit v1.3.1