mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 21:11:30 +08:00 
			
		
		
		
	fixed command line anonymization
This commit is contained in:
		
							parent
							
								
									e8cd821e57
								
							
						
					
					
						commit
						b3e66d5a83
					
				| @ -1,12 +1,24 @@ | |||||||
| const backupService = require('./services/backup'); | 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(); | ||||||
| 
 | 
 | ||||||
| backupService.anonymize().then(resp => { |  | ||||||
|         if (resp.success) { |         if (resp.success) { | ||||||
|         console.log("Anonymization failed."); |  | ||||||
|     } |  | ||||||
|     else { |  | ||||||
|             console.log("Anonymized file has been saved to: " + resp.anonymizedFilePath); |             console.log("Anonymized file has been saved to: " + resp.anonymizedFilePath); | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|             process.exit(0); |             process.exit(0); | ||||||
|  |         } else { | ||||||
|  |             console.log("Anonymization failed."); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |     catch (e) { | ||||||
|  |         console.error(e.message, e.stack); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     process.exit(1); | ||||||
| }); | }); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam