How to use the @expo/osascript.openInEditorAsync function in @expo/osascript

To help you get started, we’ve selected a few @expo/osascript examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github expo / expo-cli / packages / xdl / src / FileSystem.ts View on Github external
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');
  }
}
github expo / expo-cli / packages / xdl / src / FileSystem.ts View on Github external
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');
  }
}

@expo/osascript

Tools for running an osascripts in Node

MIT
Latest version published 5 months ago

Package Health Score

91 / 100
Full package analysis