diff --git a/install.ps1 b/install.ps1 index 27b98fd3..4446ee2f 100644 --- a/install.ps1 +++ b/install.ps1 @@ -8,7 +8,7 @@ param( $ErrorActionPreference = "Stop" $defaultInstallUrl = "https://raw.githubusercontent.com/Abdess/retrobios/main/install.py" -$defaultInstallSha256 = "98bc3ac3442126a44534c4c6817dfda2f680e9f9a5aa499efb81cccebd692ec2" +$defaultInstallSha256 = "84b6a006895a34929d99cfd890f028c2ae09e134385dfd10cc955288daaf4260" $maximumInstallerBytes = 2MB $installerExit = 0 $installer = if ($PSScriptRoot) { Join-Path $PSScriptRoot "install.py" } else { $null } diff --git a/install.py b/install.py index 25259e24..a1da727c 100644 --- a/install.py +++ b/install.py @@ -3677,6 +3677,11 @@ def _install(args: argparse.Namespace, real_stdout: TextIO) -> None: matched = [(n, p) for n, p in detected if n == args.platform] if matched: platforms = matched + elif listing: + # A listing reads the manifest and writes nothing: no folder is + # needed, and asking BizHawk's for one refused a question asked + # before downloading BizHawk. + platforms = [(args.platform, _default_dest(os_type, args.platform) or Path.cwd())] elif args.platform in PORTABLE_ONLY: # A portable emulator reads the folder beside its executable: # any default would be a folder it never opens. diff --git a/install.sh b/install.sh index 4586e004..eb6b30aa 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="98bc3ac3442126a44534c4c6817dfda2f680e9f9a5aa499efb81cccebd692ec2" +DEFAULT_INSTALL_SHA256="84b6a006895a34929d99cfd890f028c2ae09e134385dfd10cc955288daaf4260" MAX_INSTALLER_BYTES=2097152 cleanup() { diff --git a/tests/test_install_selection.py b/tests/test_install_selection.py index 3fa514b8..3cbf6857 100644 --- a/tests/test_install_selection.py +++ b/tests/test_install_selection.py @@ -665,5 +665,25 @@ class ACoreWithNothingHeldIsAnOmission(unittest.TestCase): self.assertEqual(omitted, []) +class AListingNeedsNoInstall(unittest.TestCase): + """--list-systems with --platform bizhawk stopped on "not found, name it + with --dest": a question asked before downloading BizHawk was refused.""" + + def test_bizhawk_lists_without_a_folder(self): + with FakeRepository() as repo: + manifest = json.loads((repo.root / "install" / "retroarch.json").read_text()) + manifest["platform"] = "bizhawk" + (repo.root / "install" / "bizhawk.json").write_text(json.dumps(manifest)) + env = {**repo.env(), "HOME": str(repo.root / "home"), "USERPROFILE": str(repo.root / "home")} + proc = subprocess.run( + [sys.executable, str(REPO_ROOT / "install.py"), "--platform", "bizhawk", + "--list-systems"], + env=env, capture_output=True, text=True, timeout=60, check=False, + stdin=subprocess.DEVNULL, + ) + self.assertEqual(proc.returncode, 0, proc.stdout + proc.stderr) + self.assertIn("nintendo-gba", proc.stdout) + + if __name__ == "__main__": unittest.main()