MCPcopy Index your code
hub / github.com/coder/mux / ensureAskpassScript

Function ensureAskpassScript

src/node/runtime/sshAskpass.ts:36–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34}
35
36async 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. */
54export function parseHostKeyPrompt(text: string): {

Callers 1

createAskpassSessionFunction · 0.85

Calls 1

writeFileMethod · 0.65

Tested by

no test coverage detected