From 3b0b2cc858e56109b117bbe437b7815cf552ee55 Mon Sep 17 00:00:00 2001 From: Nico Albanese Date: Mon, 27 Nov 2023 11:02:25 +0000 Subject: [PATCH] updated check for t3 app after trpc implentation change --- src/commands/init/utils.ts | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/commands/init/utils.ts b/src/commands/init/utils.ts index ac6ee785..dfa7b7fc 100644 --- a/src/commands/init/utils.ts +++ b/src/commands/init/utils.ts @@ -147,15 +147,20 @@ export const checkForExistingPackages = async (rootPath: string) => { } } - // check if t3 project - const trpcApiPath = rootPath.concat("server/api/trpc.ts"); - const trpcApiExists = existsSync(trpcApiPath); - if (trpcApiExists) { - const trpcApiContent = readFileSync(trpcApiPath, "utf-8"); - trpcApiContent.includes("create.t3.gg") - ? (configObj.t3 = true) - : (configObj.t3 = false); - } + // check if t3 project -- update 27 nov, with new implementation, this no longer exists + // const trpcApiPath = rootPath.concat("server/api/trpc.ts"); + // const trpcApiExists = existsSync(trpcApiPath); + // if (trpcApiExists) { + // const trpcApiContent = readFileSync(trpcApiPath, "utf-8"); + // trpcApiContent.includes("create.t3.gg") + // ? (configObj.t3 = true) + // : (configObj.t3 = false); + // } + + // updated check (nov 2023) for ct3a + packageJsonInitText.includes("ct3aMetadata") + ? (configObj.t3 = true) + : (configObj.t3 = false); if (configObj.packages.length > 0) { consola.success(