refactor: migrar comando new para que utilice metodos usando questionary
This commit is contained in:
+4
-14
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user