Skip to content

Commit 0663e54

Browse files
authored
Merge pull request #2403 from mzakharo/printenv
recipes: print recipe ENV on failure
2 parents fe5c909 + 5580004 commit 0663e54

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pythonforandroid/logger.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,17 +214,18 @@ def printtail(out, name, forecolor, tail_n=0,
214214
re.compile(filter_in) if filter_in else None,
215215
re.compile(filter_out) if filter_out else None)
216216
printtail(err.stderr.decode('utf-8'), 'STDERR', Err_Fore.RED)
217-
if is_critical:
218-
env = kwargs.get("env")
217+
if is_critical or full_debug:
218+
env = kwargs.get("_env")
219219
if env is not None:
220220
info("{}ENV:{}\n{}\n".format(
221221
Err_Fore.YELLOW, Err_Fore.RESET, "\n".join(
222-
"set {}={}".format(n, v) for n, v in env.items())))
222+
"export {}='{}'".format(n, v) for n, v in env.items())))
223223
info("{}COMMAND:{}\ncd {} && {} {}\n".format(
224224
Err_Fore.YELLOW, Err_Fore.RESET, os.getcwd(), command,
225225
' '.join(args)))
226226
warning("{}ERROR: {} failed!{}".format(
227227
Err_Fore.RED, command, Err_Fore.RESET))
228+
if is_critical:
228229
exit(1)
229230
else:
230231
raise

0 commit comments

Comments
 (0)