trilium/src/anonymize.js

25 lines
616 B
JavaScript
Raw Normal View History

2020-06-03 05:13:55 +08:00
const backupService = require('./services/backup');
2020-06-07 16:45:41 +08:00
const sqlInit = require('./services/sql_init');
require('./entities/entity_constructor');
2020-06-07 16:45:41 +08:00
sqlInit.dbReady.then(async () => {
try {
console.log("Starting anonymization...");
const resp = await backupService.anonymize();
if (resp.success) {
console.log("Anonymized file has been saved to: " + resp.anonymizedFilePath);
process.exit(0);
} else {
console.log("Anonymization failed.");
}
2020-06-03 05:13:55 +08:00
}
2020-06-07 16:45:41 +08:00
catch (e) {
console.error(e.message, e.stack);
2020-06-03 05:13:55 +08:00
}
2020-06-07 16:45:41 +08:00
process.exit(1);
2020-06-03 05:13:55 +08:00
});