mirror of
https://github.com/esphome/esphome.git
synced 2025-07-29 14:46:40 +00:00
Fix colors in update all (#8854)
This commit is contained in:
parent
12997451f6
commit
7ac5746e0d
@ -593,15 +593,20 @@ def command_update_all(args):
|
|||||||
middle_text = f" {middle_text} "
|
middle_text = f" {middle_text} "
|
||||||
width = len(click.unstyle(middle_text))
|
width = len(click.unstyle(middle_text))
|
||||||
half_line = "=" * ((twidth - width) // 2)
|
half_line = "=" * ((twidth - width) // 2)
|
||||||
click.echo(f"{half_line}{middle_text}{half_line}")
|
safe_print(f"{half_line}{middle_text}{half_line}")
|
||||||
|
|
||||||
for f in files:
|
for f in files:
|
||||||
print(f"Updating {color(AnsiFore.CYAN, f)}")
|
safe_print(f"Updating {color(AnsiFore.CYAN, f)}")
|
||||||
print("-" * twidth)
|
safe_print("-" * twidth)
|
||||||
print()
|
safe_print()
|
||||||
rc = run_external_process(
|
if CORE.dashboard:
|
||||||
"esphome", "--dashboard", "run", f, "--no-logs", "--device", "OTA"
|
rc = run_external_process(
|
||||||
)
|
"esphome", "--dashboard", "run", f, "--no-logs", "--device", "OTA"
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
rc = run_external_process(
|
||||||
|
"esphome", "run", f, "--no-logs", "--device", "OTA"
|
||||||
|
)
|
||||||
if rc == 0:
|
if rc == 0:
|
||||||
print_bar(f"[{color(AnsiFore.BOLD_GREEN, 'SUCCESS')}] {f}")
|
print_bar(f"[{color(AnsiFore.BOLD_GREEN, 'SUCCESS')}] {f}")
|
||||||
success[f] = True
|
success[f] = True
|
||||||
@ -609,17 +614,17 @@ def command_update_all(args):
|
|||||||
print_bar(f"[{color(AnsiFore.BOLD_RED, 'ERROR')}] {f}")
|
print_bar(f"[{color(AnsiFore.BOLD_RED, 'ERROR')}] {f}")
|
||||||
success[f] = False
|
success[f] = False
|
||||||
|
|
||||||
print()
|
safe_print()
|
||||||
print()
|
safe_print()
|
||||||
print()
|
safe_print()
|
||||||
|
|
||||||
print_bar(f"[{color(AnsiFore.BOLD_WHITE, 'SUMMARY')}]")
|
print_bar(f"[{color(AnsiFore.BOLD_WHITE, 'SUMMARY')}]")
|
||||||
failed = 0
|
failed = 0
|
||||||
for f in files:
|
for f in files:
|
||||||
if success[f]:
|
if success[f]:
|
||||||
print(f" - {f}: {color(AnsiFore.GREEN, 'SUCCESS')}")
|
safe_print(f" - {f}: {color(AnsiFore.GREEN, 'SUCCESS')}")
|
||||||
else:
|
else:
|
||||||
print(f" - {f}: {color(AnsiFore.BOLD_RED, 'FAILED')}")
|
safe_print(f" - {f}: {color(AnsiFore.BOLD_RED, 'FAILED')}")
|
||||||
failed += 1
|
failed += 1
|
||||||
return failed
|
return failed
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user