Skip to content

Commit b299244

Browse files
author
Joshua Anderson
committed
fix(database): fix if statement rather than ignore shellcheck error
1 parent 0d06570 commit b299244

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

database/bin/boot

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ function etcd_set_default {
3030
set +e
3131
ERROR="$(etcdctl --no-sync -C "$ETCD" mk "$ETCD_PATH/$1" "$2" 2>&1 >/dev/null)"
3232

33-
# We're not compairing output with -n so error doesn't apply
34-
# shellcheck disable=SC2143
35-
if [[ $? -ne 0 && $(echo "$ERROR" | grep -ive "key already exists") ]]; then
33+
if [[ $? -ne 0 ]] && echo "$ERROR" | grep -iqve "key already exists"; then
3634
echo "etcd_set_default: an etcd error occurred ($ERROR)"
3735
echo "aborting..."
3836
exit 1

0 commit comments

Comments
 (0)