import app from 'app';

import { launchFilename } from './launch';

import { Menu } from 'electron';
import { defaultMenu, loadFullMenu } from './menu';

app.on('window-all-closed', () => {
  // On OS X, we want to keep the app and menu bar active
  if (process.platform !== 'darwin') {
    app.quit();
  }
});

// First two arguments are Electron and main.js
// We'll assume the rest are the notebooks to be opened
const notebooks = process.argv.slice(2);
if (notebooks <= 0) {
  notebooks.push(null);
}

app.on('ready', () => {
  // Get the default menu first
  Menu.setApplicationMenu(defaultMenu);
  // Let the kernels/languages come in after
  loadFullMenu().then(menu => Menu.setApplicationMenu(menu));
  notebooks.forEach(launchFilename);
});

@@ -145,16 +145,48 @@
 ./menu';
+%0Aimport %7B resolve %7D from 'path';
 %0A%0Aapp.on
@@ -746,16 +746,35 @@
 tebooks.
+map(f=%3Eresolve(f)).
 forEach(

Resolve notebook paths