mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-30 17:37:26 +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.
		
			
				
	
	
		
			32 lines
		
	
	
		
			467 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			467 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| 'use strict';
 | |
| 
 | |
| /**
 | |
|  * Module dependencies
 | |
|  */
 | |
| 
 | |
| // Node.js core.
 | |
| const path = require('path');
 | |
| 
 | |
| /**
 | |
|  * Check that we're in a valid Strapi project.
 | |
|  *
 | |
|  * @returns {boolean}
 | |
|  */
 | |
| 
 | |
| const isStrapiApp = () => {
 | |
|   const pathToPackageJSON = path.resolve(process.cwd(), 'package.json');
 | |
|   let validPackageJSON = true;
 | |
| 
 | |
|   try {
 | |
|     require(pathToPackageJSON);
 | |
|   } catch (e) {
 | |
|     validPackageJSON = false;
 | |
|   }
 | |
| 
 | |
|   return validPackageJSON;
 | |
| };
 | |
| 
 | |
| module.exports = {
 | |
|   isStrapiApp
 | |
| };
 |