Support for version flag
This commit is contained in:
parent
986053ad03
commit
3734bad6ef
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue