Skip to content

Commit b3fc053

Browse files
committed
Move if-block to be 'one-liner'
1 parent 682d447 commit b3fc053

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

.semaphore/semaphore_commands.sh

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,7 @@ for dir in kafka schemaregistry ; do (cd $dir && go test -coverprofile="$coverag
77

88
# If we're on newer macOS, avoid running binaries that are not code-signed, rather, use go run.
99
# Running go-kafkacat with `go run` needs some `go get` commands, so just check existence instead.
10-
if [[ $(command codesign) ]]; then
11-
command go-kafkacat
12-
go run examples/library-version/library-version.go
13-
(go run examples/library-version/library-version.go | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false)
14-
else
15-
go-kafkacat --help
16-
library-version
17-
(library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false)
18-
fi
10+
if [[ $(command -v codesign) ]]; then stat go-kafkacat; go run examples/library-version/library-version.go; (go run examples/library-version/library-version.go | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); else go-kafkacat --help; library-version; (library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); fi
1911

2012
(gocovmerge $(find . -type f -iname "*coverage.txt") > ${coverage_profile}) || (echo "Failed to merge coverage files" && exit 0)
2113
artifact push workflow ${coverage_profile} || true

.semaphore/semaphore_integration_commands.sh

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,7 @@ for dir in kafka schemaregistry ; do (cd $dir && go test -coverprofile="$coverag
88

99
# If we're on newer macOS, avoid running binaries that are not code-signed, rather, use go run.
1010
# Running go-kafkacat with `go run` needs some `go get` commands, so just check existence instead.
11-
if [[ $(command codesign) ]]; then
12-
command go-kafkacat
13-
go run examples/library-version/library-version.go
14-
(go run examples/library-version/library-version.go | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false)
15-
else
16-
go-kafkacat --help
17-
library-version
18-
(library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false)
19-
fi
11+
if [[ $(command -v codesign) ]]; then stat go-kafkacat; go run examples/library-version/library-version.go; (go run examples/library-version/library-version.go | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); else go-kafkacat --help; library-version; (library-version | grep "$EXPECT_LINK_INFO") || (echo "Incorrect linkage, expected $EXPECT_LINK_INFO" ; false); fi
2012

2113
(gocovmerge $(find . -type f -iname "*coverage.txt") > ${coverage_profile}) || (echo "Failed to merge coverage files" && exit 0)
2214
artifact push workflow ${coverage_profile} || true

0 commit comments

Comments
 (0)