()
| 66 | } |
| 67 | |
| 68 | async 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 | |
| 90 | async function setupSSHConfig(vmId: string, prKey: string) { |
| 91 | const devboxBinary = await which('devbox', { nothrow: true }); |
no test coverage detected