2019-01-15 20:35:53 +00:00
|
|
|
const { app, Menu } = require('electron')
|
|
|
|
|
|
|
|
function output (value) {
|
|
|
|
process.stdout.write(JSON.stringify(value))
|
|
|
|
process.stdout.end()
|
|
|
|
|
|
|
|
app.quit()
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
let expectedMenu
|
|
|
|
|
|
|
|
if (app.commandLine.hasSwitch('custom-menu')) {
|
|
|
|
expectedMenu = new Menu()
|
|
|
|
Menu.setApplicationMenu(expectedMenu)
|
|
|
|
} else if (app.commandLine.hasSwitch('null-menu')) {
|
|
|
|
expectedMenu = null
|
|
|
|
Menu.setApplicationMenu(null)
|
|
|
|
}
|
|
|
|
|
2020-02-03 22:43:22 +00:00
|
|
|
app.whenReady().then(() => {
|
2019-01-15 20:35:53 +00:00
|
|
|
setImmediate(() => {
|
|
|
|
try {
|
|
|
|
output(Menu.getApplicationMenu() === expectedMenu)
|
|
|
|
} catch (error) {
|
|
|
|
output(null)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
} catch (error) {
|
|
|
|
output(null)
|
|
|
|
}
|