mirror of
https://github.com/cupcakearmy/autorestic.git
synced 2024-12-22 16:26:25 +00:00
always unlock
This commit is contained in:
parent
e8a8ccccd0
commit
ea8bf83799
@ -6,7 +6,7 @@ import handlers, { error, help } from './handlers'
|
|||||||
import { Config } from './types'
|
import { Config } from './types'
|
||||||
import { readLock, writeLock, unlock } from './lock'
|
import { readLock, writeLock, unlock } from './lock'
|
||||||
|
|
||||||
process.on('uncaughtException', err => {
|
process.on('uncaughtException', (err) => {
|
||||||
console.log(err.message)
|
console.log(err.message)
|
||||||
unlock()
|
unlock()
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
@ -32,7 +32,6 @@ export const VERBOSE = flags.verbose
|
|||||||
|
|
||||||
export let config: Config
|
export let config: Config
|
||||||
|
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
config = init()
|
config = init()
|
||||||
|
|
||||||
@ -57,8 +56,8 @@ async function main() {
|
|||||||
|
|
||||||
const fn = handlers[command] || error
|
const fn = handlers[command] || error
|
||||||
await fn(args, flags)
|
await fn(args, flags)
|
||||||
unlock()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
main()
|
||||||
main().catch((e: Error) => console.error(e.message))
|
.catch((e: Error) => console.error(e.message))
|
||||||
|
.finally(unlock)
|
||||||
|
Loading…
Reference in New Issue
Block a user