mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 15:11:31 +08:00 
			
		
		
		
	
		
			
	
	
		
			25 lines
		
	
	
		
			606 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
		
		
			
		
	
	
			25 lines
		
	
	
		
			606 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| 
								 | 
							
								const log = require('./log');
							 | 
						||
| 
								 | 
							
								const path = require('path');
							 | 
						||
| 
								 | 
							
								const fs = require('fs');
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								const RESOURCE_DIR = path.resolve(__dirname, "..");
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								const MIGRATIONS_DIR = path.resolve(RESOURCE_DIR, "migrations");
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								if (!fs.existsSync(MIGRATIONS_DIR)) {
							 | 
						||
| 
								 | 
							
								    log.error("Could not find migration directory: " + MIGRATIONS_DIR);
							 | 
						||
| 
								 | 
							
								    process.exit(1);
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								const DB_INIT_DIR = path.resolve(RESOURCE_DIR, "db");
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								if (!fs.existsSync(DB_INIT_DIR)) {
							 | 
						||
| 
								 | 
							
								    log.error("Could not find DB initialization directory: " + DB_INIT_DIR);
							 | 
						||
| 
								 | 
							
								    process.exit(1);
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								module.exports = {
							 | 
						||
| 
								 | 
							
								    RESOURCE_DIR,
							 | 
						||
| 
								 | 
							
								    MIGRATIONS_DIR,
							 | 
						||
| 
								 | 
							
								    DB_INIT_DIR
							 | 
						||
| 
								 | 
							
								};
							 |