From cdfc21c2bce6f73b693bf335c3f4dde763a5488c Mon Sep 17 00:00:00 2001 From: s2 Date: Sat, 19 May 2018 22:05:01 +0200 Subject: [PATCH] parse command line correctly when packages --- app/main.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/main.js b/app/main.js index 4ec704c7..f89b106f 100644 --- a/app/main.js +++ b/app/main.js @@ -3,7 +3,7 @@ const path = require('path'); const url = require('url'); const electronLocalshortcut = require('electron-localshortcut'); const exec = require('child_process').exec; -const args = require('minimist')(process.argv.slice(2), { +const args = require('minimist')(process.defaultApp ? process.argv.slice(2) : process.argv.slice(1), { default: { _: process.cwd() } @@ -98,7 +98,7 @@ function createWindow() { }); win.webContents.on('did-finish-load', () => { - console.log('getting file list and lock status...'); + console.log('getting file list and lock status in ' + repoDir + '...'); getLfsFileList(repoDir, (err, files) => { if (err) { @@ -178,3 +178,9 @@ ipcMain.on('lock', (event, file) => { }); app.on('ready', createWindow); + +app.on('window-all-closed', function() { + if (process.platform != 'darwin') { + app.quit(); + } +});