diff options
Diffstat (limited to 'util')
-rwxr-xr-x | util/flash_ec | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/util/flash_ec b/util/flash_ec index e55db51fd1..7bb5a463f4 100755 --- a/util/flash_ec +++ b/util/flash_ec @@ -622,8 +622,12 @@ declare -a save # $2: (optional) Value to restore for the name at exit. ####################################### function servo_save_add() { + local CTRL_RESULT= case $# in - 1) save+=( "$( "${DUT_CONTROL_CMD[@]}" "$@" )" ) + 1) CTRL_RESULT="$( "${DUT_CONTROL_CMD[@]}" "$@" )" + if [[ -n "${CTRL_RESULT}" ]]; then + save+=( "${CTRL_RESULT}" ) + fi ;; 2) save+=( "$1:$2" ) ;; @@ -650,7 +654,9 @@ function servo_save() { function servo_restore() { info "Restoring servo settings..." for ctrl in "${save[@]}"; do - dut_control "$ctrl" + if [[ -n "${ctrl}" ]]; then + dut_control "${ctrl}" + fi done } |