Skip to content

Commit 4b04692

Browse files
committed
Improve print colouring if 'fetch' fails
1 parent c8f9495 commit 4b04692

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sr/comp/cli/fetch.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@ def command(args: argparse.Namespace) -> None:
3636

3737
# In case of error `get_current_state` prints the error and returns `None`.
3838
state = get_current_state(host)
39+
print(ENDC, end='')
40+
sys.stdout.flush()
3941
if not state:
4042
continue
4143

4244
compstate.fetch(ref_compstate(host), [state], quiet=True)
43-
print(f"{ENDC}{state} fetched.")
45+
print(f"{state} fetched.")
4446

4547

4648
def add_subparser(subparsers: argparse._SubParsersAction[argparse.ArgumentParser]) -> None:

0 commit comments

Comments
 (0)