Skip to content

Commit

Permalink
updated check for t3 app after trpc implentation change
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoalbanese committed Nov 27, 2023
1 parent 9d1ab3b commit 3b0b2cc
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/commands/init/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 3b0b2cc

Please sign in to comment.