Notes/src/anonymize.js

25 lines
616 B
JavaScript
Raw Normal View History

2020-06-02 23:13:55 +02:00
const backupService = require('./services/backup');
2020-06-07 10:45:41 +02:00
const sqlInit = require('./services/sql_init');
require('./entities/entity_constructor');
2020-06-07 10:45:41 +02: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}`);
2020-06-07 10:45:41 +02:00
process.exit(0);
} else {
console.log("Anonymization failed.");
}
2020-06-02 23:13:55 +02:00
}
2020-06-07 10:45:41 +02:00
catch (e) {
console.error(e.message, e.stack);
2020-06-02 23:13:55 +02:00
}
2020-06-07 10:45:41 +02:00
process.exit(1);
2020-06-02 23:13:55 +02:00
});