1418
const { code: existsCode } = await sshExec(client, `test -x ${cliBin}`, { ignoreExitCode: true });
1419
if (existsCode === 0) {
1421
>
// Bump mtime so the retention pass below doesn't prune the
1422
>
// binary we just decided to reuse. Without this, a user
1423
>
// rotating between several desktop builds could see their
1424
>
// currently-used CLI fall out of the 5-newest window and
1425
>
// get deleted just before the next reconnect.
1426
>
const { code: touchCode } = await sshExec(client, `touch -- ${cliBin}`, { ignoreExitCode: true });
1427
>
if (touchCode === 0) {
1428
>
// Now that the in-use binary is the newest by mtime, prune
1429
>
// older commit-keyed installs. Best-effort.
1430
>
await sshExec(client, buildCleanupOldCLIsCommand(this._serverDataFolderName, this._quality), { ignoreExitCode: true });
1431
>
} else {
1432
// If we couldn't refresh mtime, skip the retention pass —
1433
// running it now could prune the binary we just decided