This commit is contained in:
typicode
2016-07-25 19:16:35 +02:00
parent b7ec9ae394
commit 9155120566
2 changed files with 7 additions and 6 deletions

View File

@ -134,12 +134,9 @@ module.exports = function (argv) {
if (chunk.trim().toLowerCase() === 's') {
var filename = 'db-' + Date.now() + '.json'
var file = path.join(argv.snapshots, filename)
app
.db
.write(file)
.then(function () {
console.log(' Saved snapshot to ' + path.relative(process.cwd(), file) + '\n')
})
var state = app.db.getState()
fs.writeFileSync(file, JSON.stringify(state, null, 2), 'utf-8')
console.log(' Saved snapshot to ' + path.relative(process.cwd(), file) + '\n')
}
})