Skip to content

Commit c69c643

Browse files
committed
Deprecate run_ignore_exit_code
1 parent 9ab646c commit c69c643

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.kokoro/psm_interop_kokoro_lib.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,24 @@ psm::tools::run_verbose() {
534534
return ${exit_code}
535535
}
536536

537+
#######################################
538+
# Run command end report its exit code. Doesn't exit on non-zero exit code.
539+
# Globals:
540+
# None
541+
# Arguments:
542+
# Command to execute
543+
# Outputs:
544+
# Writes the output of given command to stdout, stderr
545+
#######################################
546+
psm::tools::run_ignore_exit_code() {
547+
local exit_code=0
548+
"$@" || exit_code=$?
549+
550+
if (( exit_code == 0 )); then
551+
psm::tools::log "Cmd failed with exit code ${exit_code}: $*"
552+
fi
553+
}
554+
537555
psm::tools::log() {
538556
echo -en "+ $(date "+[%H:%M:%S %Z]")\011 "
539557
echo "$@"
@@ -624,6 +642,10 @@ activate_secondary_gke_cluster() {
624642

625643
#######################################
626644
# Run command end report its exit code. Doesn't exit on non-zero exit code.
645+
#
646+
# Deprecated. Use psm::tools::run_ignore_exit_code
647+
# TODO(sergiitk): delete this method when no longer used in per-language buildscripts.
648+
#
627649
# Globals:
628650
# None
629651
# Arguments:

0 commit comments

Comments
 (0)