1457
try {
1458
await sshExec(client, installCmd);
1460
>
// for the wrong platform / corrupted, this surfaces immediately.
1461
>
const { code: versionCode } = await sshExec(client, `${cliBin} --version`, { ignoreExitCode: true });
1462
>
if (versionCode !== 0) {
1463
throw new Error(`CLI at ${cliBin} failed --version check after install (exit code ${versionCode})`);
1464
}
1466
>
// Prune older commit-keyed installs now that the new binary is
1467
>
// in place and is the newest by mtime.
1468
>
await sshExec(client, buildCleanupOldCLIsCommand(this._serverDataFolderName, this._quality), { ignoreExitCode: true });
1469
>
return cliBin;
1470
} catch (installErr) {
1471
// Soft fallback (key difference from Remote-SSH): if the