|
|
@ -115,6 +115,8 @@ if (ci) colors.disable()
|
|
|
|
|
|
|
|
|
|
|
|
async function main() {
|
|
|
|
async function main() {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
if (requireConfig) {
|
|
|
|
|
|
|
|
config = init(configFile)
|
|
|
|
const lock = readLock()
|
|
|
|
const lock = readLock()
|
|
|
|
if (lock.running) throw new Error('An instance of autorestic is already running for this config file'.red)
|
|
|
|
if (lock.running) throw new Error('An instance of autorestic is already running for this config file'.red)
|
|
|
|
|
|
|
|
|
|
|
@ -122,14 +124,14 @@ async function main() {
|
|
|
|
...lock,
|
|
|
|
...lock,
|
|
|
|
running: true,
|
|
|
|
running: true,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (requireConfig) config = init(configFile)
|
|
|
|
|
|
|
|
await queue()
|
|
|
|
await queue()
|
|
|
|
if (error) process.exit(1)
|
|
|
|
if (error) process.exit(1)
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
console.error(e.message)
|
|
|
|
console.error(e.message)
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
unlock()
|
|
|
|
if (requireConfig) unlock()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
main()
|
|
|
|
main()
|
|
|
|