mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-18 17:21:33 +00:00
fix: use fs-jetpack in scripts/migrate.js
This commit is contained in:
parent
d4234261b3
commit
ebd53996d7
@ -1,4 +1,4 @@
|
||||
const paths = require('./../controllers/pathsController')
|
||||
const jetpack = require('fs-jetpack')
|
||||
const perms = require('./../controllers/permissionController')
|
||||
const config = require('./../config')
|
||||
|
||||
@ -22,14 +22,9 @@ const map = {
|
||||
|
||||
;(async () => {
|
||||
if (['better-sqlite3', 'sqlite3'].includes(config.database.client)) {
|
||||
try {
|
||||
await paths.access(config.database.connection.filename)
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
console.log('Sqlite3 database file missing. Assumes first install, migration skipped.')
|
||||
process.exit(0)
|
||||
}
|
||||
throw err
|
||||
if (!await jetpack.existsAsync(config.database.connection.filename)) {
|
||||
console.log('Sqlite3 database file missing. Assumes first install, migration skipped.')
|
||||
process.exit(0)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user