Merge pull request #126 from lzdyes/main

feat: add CTRL + C exit the application without ask
This commit is contained in:
younglei 2022-05-14 13:22:39 +08:00 committed by GitHub
commit 41eafc6252
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
import { spawn } from 'child_process'
import { createServer, build } from 'vite'
import electron from 'electron'
import readline from 'readline'
const query = new URLSearchParams(import.meta.url.split('?')[1])
const debug = query.has('debug')
@ -58,6 +59,11 @@ function watchPreload(server) {
})
}
// Block the CTRL + C shortcut on a Windows terminal and exit the application without displaying a query
if (process.platform === 'win32') {
readline.createInterface({ input: process.stdin, output: process.stdout }).on('SIGINT', process.exit)
}
// bootstrap
const server = await createServer({ configFile: 'packages/renderer/vite.config.ts' })