throw error if modules path is unspecified
This commit is contained in:
		
							parent
							
								
									c8cd2ec70e
								
							
						
					
					
						commit
						3641ce9277
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -33,6 +33,10 @@ async function readSubdir(subdir: string): Promise<dirData[]> {
 | 
			
		|||
export async function generateTypeData(): Promise<RouteData[]> {
 | 
			
		||||
  const mainDir = import.meta.env.SECRET_MODULES_PATH;
 | 
			
		||||
 | 
			
		||||
  if (!mainDir || mainDir == "") {
 | 
			
		||||
    throw new Error("Cannot generate types, missing SECRET_MODULES_PATH");
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  const subdirs = await fs.readdir(mainDir, {
 | 
			
		||||
    withFileTypes: true,
 | 
			
		||||
  });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue