From 75e577708b30163ef33830df5a6991884672cfb4 Mon Sep 17 00:00:00 2001 From: dantengsky Date: Thu, 16 Jun 2022 23:16:08 +0800 Subject: [PATCH] fix: add_profile shoud return 0 if no items found in profile --- scripts/setup/dev_setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/setup/dev_setup.sh b/scripts/setup/dev_setup.sh index 88b34f30d574..1d9fcd07d753 100755 --- a/scripts/setup/dev_setup.sh +++ b/scripts/setup/dev_setup.sh @@ -10,7 +10,7 @@ cd "$SCRIPT_PATH/../.." || exit function add_to_profile { eval "$1" - FOUND=$(grep -c "$1" <"${HOME}/.profile") + FOUND=$(grep -c "$1" "${HOME}/.profile" || true) if [ "$FOUND" == "0" ]; then echo "$1" >>"${HOME}"/.profile fi