Skip to content

Commit

Permalink
Terminal glyph is added. Path dislpays no prefix anymore.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasursadikov committed Sep 10, 2024
1 parent 44944f9 commit 1324efd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def run_ordered(self, repos: List[str], command: [str]) -> None:
command_str = ' '.join(command)
for path in repos:
result = subprocess.run(command_str, shell=True, cwd=path, capture_output=True, text=True)
print(f'{self._get_formatted_path(path)}{RESET} | {BOLD}{command_str}{RESET} {RED + utils.GLYPHS["failed"] if result.stderr else GREEN + utils.GLYPHS["finished"]} {f"{RESET}|{RED} Code: {BOLD}{result.returncode}{RESET}" if result.stderr else ""} {RESET}')
print(f'{self._get_formatted_path(path)}{RESET} {utils.GLYPHS["terminal"]} {BOLD}{command_str}{RESET} {RED + utils.GLYPHS["failed"] if result.stderr else GREEN + utils.GLYPHS["finished"]} {f"{RESET}|{RED} Code: {BOLD}{result.returncode}{RESET}" if result.stderr else ""} {RESET}')
if result.stdout and not result.stdout.strip().isspace():
print(result.stdout.strip())
if result.stderr and not result.stderr.strip().isspace():
Expand Down Expand Up @@ -291,7 +291,7 @@ def _get_table() -> PrettyTable:

@staticmethod
def _get_formatted_path(path: str) -> str:
return f'{DIM}{GRAY}../{RESET}{DIM}{path}{RESET}'
return f'{DIM}{path}{RESET}'

@staticmethod
def _get_branch_status(path: str) -> str:
Expand Down
2 changes: 2 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
'running': '\uf46a',
'label': '\uf435',
'tag': '\uf02b',
'terminal': '\ue795',
'(': '\ue0b6',
')': '\ue0b4',
'space': ' ',
Expand All @@ -50,6 +51,7 @@
'running': 'Running',
'label': '',
'tag': '',
'terminal': '',
'(': '',
')': ' ',
'space': '',
Expand Down

0 comments on commit 1324efd

Please sign in to comment.