fix: strip rich markup from questionary choices
This commit is contained in:
+4
-5
@@ -107,15 +107,14 @@ def select_mode() -> str:
|
||||
choice = questionary.select(
|
||||
"Select mode:",
|
||||
choices=[
|
||||
"[yellow]fakeroot — no root needed, degraded perf[/]",
|
||||
"[cyan]root — enter sudo password to continue as root[/]",
|
||||
"fakeroot -- no root needed, degraded perf",
|
||||
"root -- enter sudo password to continue as root",
|
||||
],
|
||||
default="[yellow]fakeroot — no root needed, degraded perf[/]",
|
||||
default="fakeroot -- no root needed, degraded perf",
|
||||
).ask()
|
||||
if choice is None:
|
||||
sys.exit(0)
|
||||
if "root" in choice:
|
||||
import subprocess
|
||||
if choice.startswith("root"):
|
||||
console.print("\n[bold]Entering root mode...[/]")
|
||||
ret = subprocess.run(["sudo", "true"], capture_output=True)
|
||||
if ret.returncode != 0:
|
||||
|
||||
Reference in New Issue
Block a user