cli: fix code tunnel on macos

This commit is contained in:
Connor Peet
2022-10-24 10:55:22 -07:00
parent 320d6012c3
commit 578d59eb72
+5 -1
View File
@@ -59,7 +59,11 @@ export async function main(argv: string[]): Promise<any> {
if (process.env['VSCODE_DEV']) {
tunnelProcess = spawn('cargo', ['run', '--', 'tunnel', ...argv.slice(5)], { cwd: join(getAppRoot(), 'cli') });
} else {
const tunnelCommand = join(dirname(process.execPath), 'bin', `${product.tunnelApplicationName}${isWindows ? '.exe' : ''}`);
const appPath = process.platform === 'darwin'
// ./Contents/MacOS/Electron => ./Contents/Resources/app/bin/code-tunnel-insiders
? join(dirname(dirname(process.execPath)), 'Resources', 'app')
: dirname(process.execPath);
const tunnelCommand = join(appPath, 'bin', `${product.tunnelApplicationName}${isWindows ? '.exe' : ''}`);
const tunnelArgs = argv.slice(3);
tunnelProcess = spawn(tunnelCommand, ['tunnel', ...tunnelArgs]);
}