How to use the electron-util.enforceMacOSAppLocation function in electron-util

To help you get started, we’ve selected a few electron-util 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 dreamnettech / dreamtime / src / electron / src / index.js View on Github external
static async setup() {
    // https://github.com/sindresorhus/electron-util#enforcemacosapplocation-macos
    enforceMacOSAppLocation()

    // application exit.
    app.on('will-quit', async (event) => {
      logger.debug('Exiting...')

      event.preventDefault()

      await this.shutdown()

      app.exit()
    })

    // windows closed, no more to do.
    app.on('window-all-closed', () => {
      app.quit()
    })
github wulkano / kap / app / src / main / index.js View on Github external
app.on('ready', () => {
  util.enforceMacOSAppLocation();

  // Ensure all plugins are up to date
  plugins.upgrade().catch(() => {});

  if (settings.get('recordKeyboardShortcut')) {
    globalShortcut.register('Cmd+Shift+5', () => {
      const recording = (appState === 'recording');
      mainWindow.webContents.send((recording) ? 'stop-recording' : 'prepare-recording');
    });
  }
});