File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff 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+
537555psm::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:
You can’t perform that action at this time.
0 commit comments