MCPcopy Index your code
hub / github.com/jetify-com/devbox / setupDevboxLauncher

Function setupDevboxLauncher

vscode-extension/src/openinvscode.ts:68–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66}
67
68async function setupDevboxLauncher(): Promise<any> {
69 // download devbox launcher script
70 const gatewayHost = 'https://releases.jetify.com/devbox';
71 const response = await fetch(gatewayHost, {
72 method: 'get',
73 });
74 const launcherPath = `${process.env['HOME']}/.config/devbox/launcher.sh`;
75
76 try {
77 const launcherScript = await response.text();
78 const launcherData = new Uint8Array(Buffer.from(launcherScript));
79 const fileHandler = await open(launcherPath, 'w');
80 await writeFile(fileHandler, launcherData, { flag: 'w' });
81 await chmod(launcherPath, 0o711);
82 await fileHandler.close();
83 } catch (err: any) {
84 console.error("error setting up launcher script" + err);
85 throw (err);
86 }
87 return launcherPath;
88}
89
90async function setupSSHConfig(vmId: string, prKey: string) {
91 const devboxBinary = await which('devbox', { nothrow: true });

Callers 1

setupSSHConfigFunction · 0.85

Calls 3

fetchFunction · 0.85
openFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected