text: import { app, BrowserWindow, Menu, shell } from 'electron'
  import path from 'path';
  
  let menu
  let template
  let mainWindow = null
  
  
  if (process.env.NODE_ENV === 'development') {
    require('electron-debug')() // eslint-disable-line global-require
  }
  
  
  app.on('window-all-closed', () => {
    if (process.platform !== 'darwin') app.quit()
  });
  
  
  const installExtensions = async () => {
    if (process.env.NODE_ENV === 'development') {
      const installer = require('electron-devtools-installer') // eslint-disable-line global-require
  
      const extensions = ['REACT_DEVELOPER_TOOLS', 'REACT_PERF']
  
      const forceDownload = !!process.env.UPGRADE_EXTENSIONS
      for (const name of extensions) {
        try {
          await installer.default(installer[name], forceDownload);
        } catch (e) { } // eslint-disable-line
      }
    }
  }
  
  app.on('ready', async () => {
    await installExtensions()
  
    mainWindow = new BrowserWindow({
      show: false,
      height: 800,
      width: 1281,
      icon: path.join(__dirname, 'app/assets/images/logo.ico'), 
      title:"Firestation"
  
    })
  
    mainWindow.loadURL(`file://${__dirname}/app/index.html`)
  
    mainWindow.webContents.on('did-finish-load', () => {
      mainWindow.show()
      mainWindow.focus()
    });
  
    mainWindow.on('closed', () => {
      mainWindow = null
    })
  
    if (process.env.NODE_ENV === 'development') {
      mainWindow.webContents.on('context-menu', (e, props) => {
        const { x, y } = props
  
        Menu.buildFromTemplate([{
          label: 'Inspect element',
          click() {
            mainWindow.inspectElement(x, y)
          }
        }]).popup(mainWindow)
      })
    }
  
    if (process.platform === 'darwin') {
      template = [{
        label: 'Electron',
        submenu: [{
          label: 'About ElectronReact',
          selector: 'orderFrontStandardAboutPanel:'
        }, {
          type: 'separator'
        }, {
          label: 'Services',
          submenu: []
        }, {
          type: 'separator'
        }, {
          label: 'Hide ElectronReact',
          accelerator: 'Command+H',
          selector: 'hide:'
        }, {
          label: 'Hide Others',
          accelerator: 'Command+Shift+H',
          selector: 'hideOtherApplications:'
        }, {
          label: 'Show All',
          selector: 'unhideAllApplications:'
        }, {
          type: 'separator'
        }, {
          label: 'Quit',
          accelerator: 'Command+Q',
          click() {
            app.quit()
          }
        }]
      }, {
        label: 'Edit',
        submenu: [{
          label: 'Undo',
          accelerator: 'Command+Z',
          selector: 'undo:'
        }, {
          label: 'Redo',
          accelerator: 'Shift+Command+Z',
          selector: 'redo:'
        }, {
          type: 'separator'
        }, {
          label: 'Cut',
          accelerator: 'Command+X',
          selector: 'cut:'
        }, {
          label: 'Copy',
          accelerator: 'Command+C',
          selector: 'copy:'
        }, {
          label: 'Paste',
          accelerator: 'Command+V',
          selector: 'paste:'
        }, {
          label: 'Select All',
          accelerator: 'Command+A',
          selector: 'selectAll:'
        }]
      }, {
        label: 'View',
        submenu: (process.env.NODE_ENV === 'development') ? [{
          label: 'Reload',
          accelerator: 'Command+R',
          click() {
            mainWindow.webContents.reload()
          }
        }, {
          label: 'Toggle Full Screen',
          accelerator: 'Ctrl+Command+F',
          click() {
            mainWindow.setFullScreen(!mainWindow.isFullScreen())
          }
        }, {
          label: 'Toggle Developer Tools',
          accelerator: 'Alt+Command+I',
          click() {
            mainWindow.toggleDevTools()
          }
        }] : [{
          label: 'Toggle Full Screen',
          accelerator: 'Ctrl+Command+F',
          click() {
            mainWindow.setFullScreen(!mainWindow.isFullScreen())
          }
        }]
      }, {
        label: 'Window',
        submenu: [{
          label: 'Minimize',
          accelerator: 'Command+M',
          selector: 'performMiniaturize:'
        }, {
          label: 'Close',
          accelerator: 'Command+W',
          selector: 'performClose:'
        }, {
          type: 'separator'
        }, {
          label: 'Bring All to Front',
          selector: 'arrangeInFront:'
        }]
      }, {
        label: 'Help',
        submenu: [{
          label: 'Learn More',
          click() {
            shell.openExternal('https://www.firestation.io')
          }
        }, {
          label: 'Documentation',
          click() {
            shell.openExternal('https://docs.firestation.io')
          }
        }, {
          label: 'View the Code',
          click() {
            shell.openExternal('https://github.com/JoeRoddy/firestation')
          }
        }]
      }];
  
      menu = Menu.buildFromTemplate(template)
      Menu.setApplicationMenu(menu)
    } else {
      template = [{
        label: '&File',
        submenu: [{
          label: '&Open',
          accelerator: 'Ctrl+O'
        }, {
          label: '&Close',
          accelerator: 'Ctrl+W',
          click() {
            mainWindow.close()
          }
        }]
      }, {
        label: '&View',
        submenu: (process.env.NODE_ENV === 'development') ? [{
          label: '&Reload',
          accelerator: 'Ctrl+R',
          click() {
            mainWindow.webContents.reload()
          }
        }, {
          label: 'Toggle &Full Screen',
          accelerator: 'F11',
          click() {
            mainWindow.setFullScreen(!mainWindow.isFullScreen())
          }
        }, {
          label: 'Toggle &Developer Tools',
          accelerator: 'Alt+Ctrl+I',
          click() {
            mainWindow.toggleDevTools()
          }
        }] : [{
          label: 'Toggle &Full Screen',
          accelerator: 'F11',
          click() {
            mainWindow.setFullScreen(!mainWindow.isFullScreen())
          }
        }]
      }, {
        label: 'Help',
        submenu: [{
          label: 'Learn More',
          click() {
            shell.openExternal('https://www.firestation.io')
          }
        }, {
          label: 'Documentation',
          click() {
            shell.openExternal('https://docs.firestation.io')
          }
        }, {
          label: 'View Source Code',
          click() {
            shell.openExternal('https://github.com/JoeRoddy/firestation')
          }
        }]
      }];
      menu = Menu.buildFromTemplate(template)
      mainWindow.setMenu(menu)
    }
  })
  