Skip to content

Commit 5f470ec

Browse files
fix
Fixing issue with spaces inbetween assignment of ThrewError. Removing the which attempt.
1 parent 14713cf commit 5f470ec

1 file changed

Lines changed: 6 additions & 13 deletions

File tree

Tools/CI/run_cmb_service.sh

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ echo "Starting with echo server on port: $echo_port and the cmb service on port:
6060

6161
# Setup -------------------------------------------------------------------------
6262

63+
ThrewError=false
6364
try() {
64-
BASH_COMMAND = "$@"
65-
ThrewError = false
66-
"$@" || throw
65+
ThrewError=false
66+
"$@" || throw "$@"
6767
}
6868

6969
throw() {
70-
echo "An error occurred executing this command: $BASH_COMMAND \n"
71-
ThrewError = true
70+
echo "An error occurred executing this command:$@ \n"
71+
ThrewError=true
7272
}
7373

7474
# Protocol Buffer Compiler ------------------------------------------------------
@@ -90,17 +90,10 @@ echo "Installed using sudo!"
9090
fi
9191

9292
# Add the PROTOC environment variable for Protocol Buffer Compiler
93-
export PROTOC=which protoc
94-
95-
# Use the PROTOC env var to see if it is correct by getting the protoc version
96-
try $PROTOC/protoc --version
97-
98-
# If that failed, then the path is incorrect. Try using the next possible path
99-
if $ThrewError; then
10093
export PROTOC="/usr/bin/protoc"
94+
10195
# Use the PROTOC env var to see if it is correct by getting the protoc version
10296
try $PROTOC/protoc --version
103-
fi
10497

10598
# If that failed, then the path is incorrect. Try using the next possible path
10699
if $ThrewError; then

0 commit comments

Comments
 (0)