From 3641ce927700adfb2923549c3173eaca6d521cd2 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Thu, 24 Oct 2024 19:14:46 -0700 Subject: [PATCH] throw error if modules path is unspecified --- src/config/io/generateTypeData.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/config/io/generateTypeData.ts b/src/config/io/generateTypeData.ts index a39479f..e789a5f 100644 --- a/src/config/io/generateTypeData.ts +++ b/src/config/io/generateTypeData.ts @@ -33,6 +33,10 @@ async function readSubdir(subdir: string): Promise { export async function generateTypeData(): Promise { 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, });