| 77 | } |
| 78 | |
| 79 | function buildDefaultCheckCommand(binaryCommand, installer) { |
| 80 | const executable = String( |
| 81 | installer?.binaryPath || installer?.executable || binaryCommand || "", |
| 82 | ).trim(); |
| 83 | if (!executable) return ""; |
| 84 | if (installer?.kind === "manual" && installer?.binaryPath) { |
| 85 | return `test -x ${quoteArg(installer.binaryPath)}`; |
| 86 | } |
| 87 | if (executable.includes("/")) { |
| 88 | return `test -x ${quoteArg(executable)}`; |
| 89 | } |
| 90 | return `which ${quoteArg(executable)}`; |
| 91 | } |
| 92 | |
| 93 | async function promptInstaller(binaryCommand) { |
| 94 | const method = await select( |