Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function openConsoleAsync(dir: string) {
if (process.platform === 'darwin') {
await osascript.openFolderInTerminalAppAsync(dir);
} else if (process.platform === 'win32') {
execSync(`start cmd /K "cd /d ${dir}"`);
} else {
throw new XDLError('PLATFORM_NOT_SUPPORTED', 'openConsoleAsync not supported');
}
}