fix: pass --from to the runs the tui starts

The interface accepted --from and its check and install runs never got it, so they downloaded what the folder holds. Pins in install.sh and install.ps1 follow install.py.
This commit is contained in:
Abdessamad Derraz committed 2026-10-23 16:56:27 +02:00
1 parent 0369c75dfe
commit c496014f64
4 files changed
+20 -2

No files matched your search

+1 -1
View File
@@ -11,7 +11,7 @@
$ErrorActionPreference = "Stop"
$defaultInstallUrl = "https://raw.githubusercontent.com/Abdess/retrobios/main/install.py"
$defaultInstallSha256 = "479b73569414c3e22a10b3a64fe8e57460b858ffa6a3fc0088357affea2e983e"
$defaultInstallSha256 = "163a216c1b09e8d788d4de6148194705813d4c6b8a956c84a70a267205f2c25d"
$maximumInstallerBytes = 2MB
$installerExit = 0
$installer = if ($PSScriptRoot) { Join-Path $PSScriptRoot "install.py" } else { $null }
+4
View File
@@ -10665,6 +10665,10 @@ def _tui_passthrough(args: argparse.Namespace) -> list[tuple[str, str | None]]:
flags.append((flag, str(Path(value).absolute())))
flags += [("--emulator", name) for name in args.emulator or []]
flags += [("--from-pack", str(Path(pack).absolute())) for pack in args.from_pack or []]
# The handheld launchers start --tui --from the other card: without it here
# the runs downloaded what that card holds.
flags += [("--from", str(Path(folder).absolute()))
for folder in getattr(args, "from", None) or []]
for flag in ("--every-board", "--standalone-copies", "--verbose"):
if getattr(args, flag[2:].replace("-", "_")):
flags.append((flag, None))
+1 -1
View File
@@ -18,7 +18,7 @@ esac
TEMP_INSTALLER=""
TEMP_DIRECTORY=""
DEFAULT_INSTALL_URL="https://raw.githubusercontent.com/Abdess/retrobios/main/install.py"
DEFAULT_INSTALL_SHA256="479b73569414c3e22a10b3a64fe8e57460b858ffa6a3fc0088357affea2e983e"
DEFAULT_INSTALL_SHA256="163a216c1b09e8d788d4de6148194705813d4c6b8a956c84a70a267205f2c25d"
MAX_INSTALLER_BYTES=2097152
cleanup() {
+14
View File
@@ -399,6 +399,20 @@ class Flow(unittest.TestCase):
press(state, "enter")
self.assertEqual(state.exit_code, 0)
def test_every_run_reads_the_folders_given_with_from(self):
"""--tui --from OLD: the check and the install both copy from OLD."""
args = _args(**{"from": [Path("old-card"), Path("backup.zip")],
"from_pack": [Path("pack.zip")]})
flags = install._tui_passthrough(args)
self.assertIn(("--from", str(Path("old-card").absolute())), flags)
self.assertIn(("--from", str(Path("backup.zip").absolute())), flags)
self.assertIn(("--from-pack", str(Path("pack.zip").absolute())), flags)
state = checked_state()
state.passthrough = flags
for run in ("check", "install"):
self.assertIn(f"--from={Path('old-card').absolute()}",
install.tui_argv(state, run, "py", "i.py"))
def test_the_check_runs_with_the_command_line_choices(self):
state = fresh_state()
state.passthrough = [("--target", "switch")]