From b33d56a4594ed16eaddadff3c68c1f94c87648ae Mon Sep 17 00:00:00 2001 From: Binh-Nguyen Tran Date: Sat, 20 Jul 2024 17:07:51 +0800 Subject: [PATCH] bootstrap.sh: use exact match instead of substring when checking user id existence Signed-off-by: Binh-Nguyen Tran --- scripts/bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index b1f7096..20933ae 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -252,7 +252,7 @@ get_users_list() { } user_exists() { - if [[ "$(get_users_list | jq --raw-output --arg id "$1" '.data.users | any(.[]; contains({"id": $id}))')" == 'true' ]]; then + if [[ "$(get_users_list | jq --raw-output --arg id "$1" '.data.users | any(.[]; .id == $id)')" == 'true' ]]; then return 0 else return 1