diff --git a/install.ps1 b/install.ps1 index 3524c08d..38055c5f 100644 --- a/install.ps1 +++ b/install.ps1 @@ -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 } diff --git a/install.py b/install.py index 82b8fd3c..87dce8fa 100644 --- a/install.py +++ b/install.py @@ -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)) diff --git a/install.sh b/install.sh index 316460d2..c46a1c1d 100755 --- a/install.sh +++ b/install.sh @@ -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() { diff --git a/tests/test_install_tui.py b/tests/test_install_tui.py index d94142d5..9d207ee2 100644 --- a/tests/test_install_tui.py +++ b/tests/test_install_tui.py @@ -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")]