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 openProjectInEditorAsync(dir: string) {
if (process.platform === 'darwin') {
// This will use the ENV var $EXPO_EDITOR if set, or else will try various
// popular editors, looking for one that is open, or if none are, one that is installed
return await osascript.openInEditorAsync(dir, process.env.EXPO_EDITOR);
} else {
throw new XDLError('PLATFORM_NOT_SUPPORTED', 'openProjectInEditorAsync not supported');
}
}
export async function openFileInEditorAsync(path: string) {
if (process.platform === 'darwin') {
// This will use the ENV var $EXPO_EDITOR if set, or else will try various
// popular editors, looking for one that is open, or if none are, one that is installed
return await osascript.openInEditorAsync(path, process.env.EXPO_EDITOR);
} else {
throw new XDLError('PLATFORM_NOT_SUPPORTED', 'openFileInEditorAsync not supported');
}
}