mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-20 17:22:08 +03:00
9981da93ed
* feat(mode) cleanup * fix(cli) fix bin entry
16 lines
291 B
JavaScript
16 lines
291 B
JavaScript
module.exports = function (fn) {
|
|
const cleanup = () => {
|
|
try {
|
|
fn()
|
|
} finally {
|
|
process.exit()
|
|
}
|
|
}
|
|
|
|
process.on('exit', cleanup)
|
|
process.on('SIGINT', cleanup)
|
|
process.on('SIGTERM', cleanup)
|
|
process.on('SIGHUP', cleanup)
|
|
process.on('SIGBREAK', cleanup)
|
|
}
|