Support for version flag

This commit is contained in:
Svallinn 2021-03-07 16:07:09 +00:00
parent 986053ad03
commit 3734bad6ef
No known key found for this signature in database
GPG Key ID: 09FB527F34037CCA
1 changed files with 457 additions and 448 deletions

View File

@ -2,6 +2,14 @@ import { app, BrowserWindow, Menu, ipcMain, screen } from 'electron'
import { productName } from '../../package.json'
import Datastore from 'nedb'
if (process.argv.includes('--version')) {
console.log(`v${app.getVersion()}`)
app.exit(0)
} else {
runApp()
}
function runApp() {
require('@electron/remote/main').initialize()
require('electron-context-menu')({
@ -554,3 +562,4 @@ function setMenu () {
const menu = Menu.buildFromTemplate(template)
Menu.setApplicationMenu(menu)
}
}