1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

android: fixing exit code checking

This fixes an issue introduced in
64261a65cb8c4c7daeb35186f16d246d3211fa0a

The addtional echo means that $? will always have "0" (the exit code for
the echo). This removes the extra echo, prepending \n to $? instead
This commit is contained in:
Sergei Trofimov 2015-12-11 17:18:18 +00:00
parent 2d9c0bf8a5
commit f52bf79eb6

View File

@ -293,7 +293,7 @@ def adb_shell(device, command, timeout=None, check_exit_code=False, as_root=Fals
escape_double_quotes(command)) escape_double_quotes(command))
logger.debug(full_command) logger.debug(full_command)
if check_exit_code: if check_exit_code:
actual_command = "adb{} shell '({}); echo; echo $?'".format(device_string, actual_command = "adb{} shell '({}); echo \"\n$?\"'".format(device_string,
escape_single_quotes(command)) escape_single_quotes(command))
raw_output, error = check_output(actual_command, timeout, shell=True) raw_output, error = check_output(actual_command, timeout, shell=True)
if raw_output: if raw_output: