refactor: migrar comando new para que utilice metodos usando questionary

This commit is contained in:
jt
2026-07-14 00:22:22 -03:00
parent 4968667dad
commit a5a753f429
6 changed files with 104 additions and 55 deletions
+4 -14
View File
@@ -140,17 +140,7 @@ class Git:
return process
def _run(self, print: str | None = None, check: bool = True):
process = subprocess.run(
self.command, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL
)
if print is not None:
self._print_process("", "", title=print)
if check:
process.check_returncode()
return process
return self._get(print, check)
def _print_process(self, stdout: str, stderr: str, title: str):
command = []
@@ -164,12 +154,12 @@ class Git:
command.append(arg)
text = f"[yellow]$ {" ".join(command)}[/yellow]"
text = f"[green]$ {" ".join(command)}[/green]"
for line in stdout.splitlines():
text += "\n\\[out] " + line
text += "\n" + line
for line in stderr.splitlines():
text += "\n[red]\\[err][/red] " + line
text += "\n[red]" + line + "[/red]"
panel(title or "Ejecutando", text)