()
| 34 | } |
| 35 | |
| 36 | async function ensureAskpassScript(): Promise<string> { |
| 37 | if (askpassPath) { |
| 38 | try { |
| 39 | await fs.promises.access(askpassPath, fs.constants.X_OK); |
| 40 | return askpassPath; |
| 41 | } catch { |
| 42 | // Recreate the helper script if it was deleted. |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | const dir = path.join(os.homedir(), ".mux", "bin"); |
| 47 | await fs.promises.mkdir(dir, { recursive: true }); |
| 48 | askpassPath = path.join(dir, "mux-askpass"); |
| 49 | await fs.promises.writeFile(askpassPath, ASKPASS_SCRIPT, { mode: 0o755 }); |
| 50 | return askpassPath; |
| 51 | } |
| 52 | |
| 53 | /** Parse host/keyType/fingerprint from OpenSSH output. */ |
| 54 | export function parseHostKeyPrompt(text: string): { |
no test coverage detected