mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 15:11:31 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			616 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			616 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
const backupService = require('./services/backup');
 | 
						|
const sqlInit = require('./services/sql_init');
 | 
						|
require('./entities/entity_constructor');
 | 
						|
 | 
						|
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.");
 | 
						|
        }
 | 
						|
    }
 | 
						|
    catch (e) {
 | 
						|
        console.error(e.message, e.stack);
 | 
						|
    }
 | 
						|
 | 
						|
    process.exit(1);
 | 
						|
});
 |