mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-31 01:47:13 +00:00 
			
		
		
		
	 154fc28a57
			
		
	
	
		154fc28a57
		
	
	
	
	
		
			
			As a result of taking a look on PR #1967 I realized there is 819 executable files in this repository. It is obvious this is an error.
		
			
				
	
	
		
			37 lines
		
	
	
		
			824 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
		
			824 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| 'use strict';
 | |
| 
 | |
| /**
 | |
|  * Module dependencies
 | |
|  */
 | |
| 
 | |
| // Node.js core.
 | |
| const fs = require('fs');
 | |
| const path = require('path');
 | |
| 
 | |
| /**
 | |
|  * Generate a core API
 | |
|  */
 | |
| 
 | |
| module.exports = {
 | |
|   templatesDirectory: scope => {
 | |
|     try {
 | |
|       // Try to reach the path. If it fail, throw an error.
 | |
|       fs.accessSync(path.resolve(__dirname, '..', 'templates', scope.args.tpl), fs.constants.R_OK | fs.constants.W_OK);
 | |
| 
 | |
|       return path.resolve(__dirname, '..', 'templates', scope.args.tpl);
 | |
|     } catch (e) {
 | |
|       // Default template is Mongoose
 | |
|       return path.resolve(__dirname, '..', 'templates', 'mongoose');
 | |
|     }
 | |
|   },
 | |
|   before: require('./before'),
 | |
|   targets: {
 | |
|     ':filePath/models/:filename': {
 | |
|       template: 'model.template'
 | |
|     },
 | |
|     ':filePath/models/:filenameSettings': {
 | |
|       template: 'model.settings.template'
 | |
|     }
 | |
|   }
 | |
| };
 |