Skip to content

Commit 2900b5c

Browse files
committed
check topic logic
1 parent c78ac26 commit 2900b5c

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

scripts/cli/playground

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24812,10 +24812,9 @@ playground_topic_create_command() {
2481224812
get_security_broker "--command-config"
2481324813
get_environment_used
2481424814

24815-
playground topic get-number-records --topic $topic > /tmp/result.log 2>/tmp/result.log
2481624815
set +e
24817-
grep "does not exist" /tmp/result.log > /dev/null 2>&1
24818-
if [ $? == 0 ]
24816+
existing_topics=$(playground get-topic-list)
24817+
if ! echo "$existing_topics" | grep -qFw "$topic"
2481924818
then
2482024819
set -e
2482124820
log "🆕 Creating topic $topic"

scripts/cli/src/commands/topic/create.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ verbose="${args[--verbose]}"
55
get_security_broker "--command-config"
66
get_environment_used
77

8-
playground topic get-number-records --topic $topic > /tmp/result.log 2>/tmp/result.log
98
set +e
10-
grep "does not exist" /tmp/result.log > /dev/null 2>&1
11-
if [ $? == 0 ]
9+
existing_topics=$(playground get-topic-list)
10+
if ! echo "$existing_topics" | grep -qFw "$topic"
1211
then
1312
set -e
1413
log "🆕 Creating topic $topic"

0 commit comments

Comments
 (0)